How to Make Code Program Simple Calculator in Python 2023!

Опубликовано: 12 Февраль 2026
на канале: Simple Fixing
20
2

Remember, you can't divide anything by 0; Even python can't handle it.
This is a simple calculator that you can make in python without using any 'defines' or importing modules.
You can see that to multiply, you have to use the star (*) symbol because in python, that means multiplication. And to divide, you use the slash (/) for the same reason.

while True:
f_num = int(input("Enter first number: "))
prc = input("Enter process ('+', '-', 'x', '/'): ")
s_num = int(input("Enter second number: "))

if prc == "+":
print("Result: %s" % (f_num + s_num))
elif prc == "-":
print("Result: %s" % (f_num - s_num))
elif prc == "x":
print("Result: %s" % (f_num * s_num))
elif prc == "/":
print("Result: %s" % (f_num / s_num))
else:
print("Error...")
print("====================================================")

In this video, I used a code editor by Microsoft called "Visual Studio Code".
If you have any questions, please ask/tell me in the comments.
Thank you :D