Mar-25-2018, 02:20 PM
(Mar-25-2018, 09:53 AM)orangevalley Wrote: so its:
elif: for age in range (o> -100:) print("Try again after you are born!.")
Did you try running it? You typed the letter 'o' for the number '0'. Why are you using 'range' at all? Why not just use 'age <= 0' as you did when testing for an input over 100.
In your 'else:' statement, if all works correctly, 'age' will always be between 1 and 99, subtracting 100 from 'age' will always make 'x' a negative number.
Finally, in your 'else' statement, the print function will cause an error. Can you see what the problem is?
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition