I get a weird error every time I run this program for ps6. The program works fine but I get a extra line with "None" in it every time it loops through the play_hand. Any ideas? http://dpaste.com/hold/565450/
i put some print statements in to pinpoint it: i started with one print statement to see if it was happening before or after a certain line, then added more till i had it 'bracketed'. i used print 'print1' (and 'print2' ...) http://dpaste.com/565459/ i think I know why but i'll give you a chance to figure it out.
I can't really tell. It just seems like there is a phantom print "None" after "print 'Current Hand:', display_hand(hand)" and "print 'print1'"
"display_hand" prints results itself but does not return the hand back to "play_hand". when you call "display_hand" in "play_hand" you have a print statement so it prints what it got returned from "display_hand" which is by default "None". Change display_hand to return rather than print and the problem goes away.
I understand now, but can you just make a function return nothing instead of None?
my understanding is that a function always returns "something" but I suppose I could be mistaken.
ok. thanks for the help!
Join our real-time social learning platform and learn together with your friends!