Jun-15-2017, 07:46 PM
A quick glance shows a mix of 'input()' and 'raw_input'. If you are using Python 2.x use 'raw_input()', if you are using Python 3.x, use 'input()'.
In both cases, the variables will be strings, so you must use them as strings, not numbers. So for example in your 'menu' function, you have the comparison of a 'string' with a number:
In both cases, the variables will be strings, so you must use them as strings, not numbers. So for example in your 'menu' function, you have the comparison of a 'string' with a number:
if choice==1: # choice is a string, 1 is an integeryou could resolve this by making your numbers into strings:
if choice=="1": # Note the quotes around the number 1Another solution would be to get an integer value rather than a string:
choice = int(input("Enter a number: "))
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