0

Tell me why my code not working

Why my code don't working ... first = input("enter first number") second = input("enter second number") operator = input("enter your operator" , +,-,*,%,Ă·,) if operator = "+" : print(first + second ) else : print("thnx")

1st Jan 2023, 12:05 PM
Yash Kumar
Yash Kumar - avatar
1 Answer
+ 9
Yash Kumar , see my comments in your code: first = input("enter first number") # we need to convert input to integer number second = input("enter second number") # we need to convert input to integer number operator = input("enter your operator" , +,-,*,%,Ă·,) # closing quote not at correct position if operator = "+" : # for comparison we have to use == print(first + second ) else : print("thnx")
1st Jan 2023, 12:14 PM
Lothar
Lothar - avatar