I'm having trouble with the hangman game in the problem set 2 exercises.... I have wrote my code starting from the point where it says "your code begins here!" starting with a 'def' function to show the random word chosen as a bunch of underscores, just like the solution code. I can't see much significantly different to the solutions code either... When I try and run my script it terminates just after stating how many words were loaded... did anyone else have this problem?
Can you use one of these: http://dpaste.com/ http://pastebin.com/ http://gist.github.com/ Put your code up and paste a link. Then people can see it. Another good tool to use is print statements. Print things here and there that might be of interest. This can help you find values you do not expect, which can lead to answers.
Don't forget that in Python indentation is critical for defining functions, blocks and classes.
@ash.nz how did it terminate?
it just terminates after the it says '_____ words loaded' and then returns cleanly to the command prompt line
would you like to post your code? have you tried using print statements?
Join our real-time social learning platform and learn together with your friends!