How to make a simple Calculator in Python?
Answers
Answered by
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
Answered by
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
Social Sciences,
8 months ago
Math,
8 months ago
Science,
8 months ago
India Languages,
1 year ago
Chinese,
1 year ago
Math,
1 year ago
Math,
1 year ago