I'm trying to switch a code from Python 2.7.10 to Python 3, and some things aren't working. I just recently was introduced to Python.
choice = 2 while choice != 1 and choice != 0: choice = input("Hello, no.") if choice != 1 and choice != 0: print("Not a good code.") How do I change the "!=" into something Python 3 will understand? When I type in 1 or 0, it gives me my "hello, no" invalid print.
inputin Python3 returns a string. You must convert it to anintbefore comparing. Third,you may find this document useful: docs.python.org/3/howto/pyporting.html