Sublime Forum

SyntaxError: unexpected EOF while parsing

#1

hope i’m posting correct here. Using a simple calculator to test sublime3, but i get a parsing error in sublime but program runs fine from the linux terminal. Am using python3 and am building on sublimeREPL, any ideas? thanks!

num1 = float(input('first number: '))
num2 = float(input('second number: '))
oper = input('operator: ')

if oper == ‘+’:
print(num1 + num2)
elif oper == ‘-’:
print(num1 - num2)
elif oper == ‘*’:
print(num1 * num2)
elif oper == ‘/’:
print(num1 / num2)
else:
print(‘bad operator’)

first number: 60
second number: 30
operator: +
Traceback (most recent call last):
File “simple_calculator.py”, line 4, in
oper = input('operator: ')
File “”, line 1
+
^
SyntaxError: unexpected EOF while parsing

Repl Closed

0 Likes

#2

See Build broken? - Python 3 - input()

0 Likes