Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 6 Online
OpenStudy (anonymous):

on ps5 - Problem#4. (during implementation of play_hand(hand,word_list)) I found that the code: print display_hand(hand) will print: AND in the next line . 1. Can any body tell me why this happens. 2. Could I print in the same line any legend and the return of "display_hand"? (without the )

OpenStudy (anonymous):

a function will always return something, even if you don't tell it to (at least in Python). A function will return None by default. I imagine that in display_hand you made a string and then printed it - when executed/called that function will print the string and then return None - " print display_hand(hand) " will cause the function to execute then it will print the return value. In display_hand if you change print string(or whatever) to return string(or whatever) it should work http://docs.python.org/tutorial/controlflow.html#defining-functions http://docs.python.org/reference/compound_stmts.html#function-definitions it always helps to post your code or a code snippit using a code pasting site: dpaste.com pastebin.com codepaste.com .......................

OpenStudy (anonymous):

Thanks.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!