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

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -