Unindent line 18-21 - that will solve your problem.
Read PEP-8 - that will help you to write Pythonic code.
Read PEP-8 - that will help you to write Pythonic code.
(Sep-15-2018, 04:07 PM)Placebo Wrote: 1.) How this little program knows whicch number it has defiend as the secretnumber that is to guess?
I see only that within the code a range is defined, of where the secretnumber lies, but I do not see an exact determined value?
2.) Is 'guessesTaken' somehow an already defined value in python?
- Returned by call to
random.randint
- Of course not, among many reasons - it's un-Pythonic
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.