1

I'm not sure what the issue is with my code but I get the error "Unexpected EOF while parsing" when attempting to go through my try and except code. Here is the code that's causing problems: `

def main():
    t = False
    while t != True:
        print('1) Addition\n')
        print('2) Subtraction\n')
        print('3) Division\n')
        print('4) Multiplication\n')
        print('5) Exponential\n')
        print('6) Exit\n')

        choice = input('Enter choice (from 1-6): ')
        try:
            send = input('Enter numbers (seperate by space: ')
            a, b = send.split(' ')
            a = int(a)
            b = int(b)
        except TypeError:
            print('Invalid Input')

main()

`

Any help is appreciated. Thank you.

IcePJ
  • 21
  • 1
  • 1
    You are using Python 2, and you should be using `raw_input` instead of `input`. It's trying to parse an input like `1 2` as a Python expression and failing. – chepner Feb 21 '19 at 20:58
  • Thanks. I'll have to uninstall 2.x.x and put 3.x.x. – IcePJ Feb 21 '19 at 20:59

0 Answers0