I'm working my way through "How to Think Like a Computer Scientist Learning with Python" from this link:
http://www.greenteapress.com/thinkpy...ml/chap20.html.
In 'The animal tree" program I keep getting a " 'continue' not properly in loop" error. It's coming from the "make a guess" section of the code:
Expand|Select|Wrap|Line Numbers
- # make a guess
- guess = tree.getCargo()
- prompt = "Is it a " + guess + "? "
- if yes(prompt):
- print "I rule!"
- continue
Isn't this incorrect coding in the first place? Isn't continue only used in "for" and "while" loops? That's what I've read in the Python Tutorial. I've tried "break" and "pass" in place of "continue", but none of those work either. How do I get the program to continue on to the next prompt ""What is the animal's name? " ?
Thanks