14,933,227 members
See more:
```#! python3

import os
os.system("cls")

number1 = float(input("please enter number one"))
number2 = float(input("please enter number two"))

if(choice == "1"):
print("%0.2f" %number1, "+", "%0.2f" %number2, "=", (number1 + number2))
elif(choice == "2"):
print("%0.2f" %number1, "-", "%0.2f" %number2, "=", (number1 - number2))
elif(choice == "3"):
print("%0.2f" %number1, "*", "%0.2f" %number2, "=", (number1 * number2))
elif(choice == "4"):
if(number2 != 0):
print("%0.2f" %number1, "/", "%0.2f" %number2, "=", (number1 / number2))
else:
print("The denominator should not be zero to divide")

else:
print("you have given invalid operator, please try again with a different operator")

----------------------#Below is another short code I tried-----------------------------------

#! python3

import os
os.system("cls")

number1 = int(input("please enter number one"))
number2 = int(input("please enter number two"))

if(choice == "1"):
elif(choice == "2"):
print("the subtraction  is",  (number1-number2))
elif(choice == "3"):
print("the multiplication is", (number1*number2))
elif(choice == "4"):
if(number2 !=0):
print("The division is", (number1 / number2))
else:
print("The denominator should not be zero to divide")
else:
print("you have given incorrect operation number, please try again")
```

What I have tried:

I have tried indentation and also changing brackets etc but same issue
Posted
Updated 10-Jun-21 4:47am
v2

## Solution 1

`choice` is an integer, you comparing it to a string constant.
Try removing the double quotes in each `if` and `elif` condition.

Thanks a lot... It worked.. I am new and learning code on my own form home. I do not have anyone to help. You just made my day
OriginalGriff 10-Jun-21 11:03am

You're welcome!

## Solution 2

`choice` is an integer. An integer will never be equal to a string. Therefore, `choice == "1"` can never be true.

Compare the value to an integer instead:
Python
`if(choice == 1):`

Thanks a lot... It worked.. I am new and learning code on my own form home. I do not have anyone to help. You just made my day

## Solution 3

Python
`if(choice == "1"):`

You have declared choice as an integer value, but you are here comparing it to a string.
Change it to a number without the quotes:
Python
`if choice == 1:`

And do the same with the other tests.

Thanks a lot... It worked.. I am new and learning code on my own form home. I do not have anyone to help. You just made my day
Richard MacCutchan 10-Jun-21 10:49am

You can find lots of good information at The Python Tutorial — Python 3.7.10 documentation[^].

## Solution 4

It worked. Thanks a lot guys. You are my true helpers