python - Why is there showing a 'None' in the Output? -
python - Why is there showing a 'None' in the Output? -
my programm shell show grid , programm has lot of functions calling each other. problem there 3 nones showing in output. can imagine it's because in bracket after funtionname written no argument in instead of do_twice , do_fourth. don't need argument because have written function execute function do_quater in end. don't know if should declare in function variable hint none.
def do_twice(f): f() f() def do_fourth(f): do_twice(f) do_twice(f) def do_row(): print '+----', print '+' def do_worms(): print '| |' print '| |' print '| |' print '| |' def do_wormsr(): print '| |' print '| |' print '| |' print '| |' def do_row(): print '+----', print '+' def do_worms(): print '| |' print '| |' print '| |' print '| |' def do_wormsr(): print '| |' print '| |' print '| |' print '| |' def do_row(): print '+----', print '+' def do_row(): print '+----', print '+' def do_quarter(): print do_row() print do_worms() print do_wormsr() print do_row() print do_worms() print do_wormsr() print do_row()
any python function not have return value
return none
default when print do_row()
etc.. none
after print output
not sure printing need along lines of next remove none output:
def do_row(): homecoming '+----+'
python function nonetype
Comments
Post a Comment