Why am I getting a multiple statements found while compiling a single statement error? (Python) -
i keep getting error in rudimentary calculator program in python version 3.3.1. cannot find problem myself, can me? thank in advance!
x=(input("which operation perform?")) if x=='addition': y=int(input("enter first number?")) z=int(input("enter second number?")) a=y+z print(a) elif x=='subtraction': y=int(input("enter first number?")) z=int(input("enter second number?")) a=y-z print(a) elif x=='multiplication': y=int(input("enter first number?")) z=int(input("enter second number?")) a=y*z print(a) elif x=='division': y=int(input("enter first number?")) z=int(input("enter second number?")) a=y/z print(a)
your tabs messed think, try :
x=input("which operation perform?") if x=='addition': y=int(input("enter first number?")) z=int(input("enter second number?")) a=y+z print(a) elif x=='subtraction': y=int(input("enter first number?")) z=int(input("enter second number?")) a=y-z print(a) elif x=='multiplication': y=int(input("enter first number?")) z=int(input("enter second number?")) a=y*z print(a) elif x=='division': y=int(input("enter first number?")) z=int(input("enter second number?")) a=y/z print(a)
Comments
Post a Comment