0
Find the error
first_number = input ("enter first number ==> ") second_number = input("\nenter second number==>") first_number = int(first_number) second_number = int(second_number) print("\n------press key for operation------ @ '+','-','*','/'") operator = input ("\nenter the key==>") if operator == '+': print(first_number + second_number) elif operator =='-': print(first_number - second_number) elif operator =='*': print(first_number * second_number) elif operator =='/': print(first_number / second_number) else print("\n-----invalid input-----")
2 Answers
+ 2
All the `elif` and `else` blocks should be at the same indentation level with the `if` block
if <condition>:
# code for if block
elif <condition>:
# code for elif block
elif <another-condition>:
# code for another elif block
else:
# code for else block
P.S. You missed a colon : after the `else` statement.