Apr-20-2017, 09:44 PM
BDFL forbids - no
GOTO
You just put this block into a loop - one variant is infinite loopwhile True: if <bla-bla-bla>: ....... else: print('You chose wrong') continue breakUnless you make a legal choice, your code will fall through to the final
else
, where continue
will force the loop to return to beginning. On legal choice, loop will be ended by break
Test everything in a Python shell (iPython, Azure Notebook, etc.)
- Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
- Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
- You posted a claim that something you did not test works? Be prepared to eat your hat.