This is my code it works fine on Python 3 but doesn't work on Python2
This is the code:
while True:
userCommand = input("> ").lower()
if userCommand == "help" or userCommand == "?":
print("not yet...")
else:
print("Command not recognised.")
When I type"help", I am getting this error:
Traceback (most recent call last):
File "customCLI.py", line 2, in <module>
userCommand = input("> ").lower()
AttributeError: '_Helper' object has no attribute 'lower'
The other error I am getting is :
Traceback (most recent call last):
File "customCLI.py", line 2, in <module>
userCommand = input("> ").lower()
File "<string>", line 1, in <module>
NameError: name 'blahblah' is not defined
Any help will be appreciated