Computer Science, asked by Jas41, 1 year ago

How to make a simple Calculator in Python?

Answers

Answered by Ricky1610
0
Try to visit github and find the source code and then compile them and build your calculator

Jas41: Hi there,and thanks a lot for your anwet
Jas41: anser*
Jas41: do you have interest in Computer sciences or software engineering?
Answered by someshkumarsatapathy
0

num1 = int(input("Enter the First Number: "))

opression = input('Enter the opression:')

num2 = int(input("Enter the second Number: "))

if ("+" in opression):

   print(num1+num2)

elif ("-" in opression):

   print(num1-num2)

elif ("*" in opression):

   print(num1*num2)

elif ("/" in opression):

   print(num1/num2)

Explanation:

Here you can also add captions to your result for example:

print(f"the sum of {num1} and {num2} is {num1+num2}")

For adding caption you should use f string in this variable are declared in curly brackets {}.

Hope it helps

Similar questions