Build a Python Calculator App | Python Project for Beginners | GaneshRawatz

Veröffentlicht am: 04 Juni 2025
auf dem Kanal: GANESH RAWAT
139
7

Learn to code a simple Python calculator app ! This beginner-friendly tutorial shows you how to create a program that adds, subtracts, multiplies, and divides. Full code below! 👇 Perfect for Python newbies. What’s your next coding project? Comment below!
#Python #pythonprojects #pythonprojectideas #pythonforbeginners #CodingTutorial #BeginnerPython #pythonprojectsforbeginners #pythonprojectswithsourcecode #calculation #calculator #calculatorappinpython #pythoncalculator
Subscribe ‪@GaneshRawatz‬ for more projects.
Code:
def add(x, y):
print(f"{x} + {y} = {x+y}\n")
def sub(x, y):
print(f"{x} - {y} = {x-y}\n")
def mul(x, y):
print(f"{x} x {y} = {x*y}\n")
def div(x, y):
print(f"{x} / {y} = {x/y}\n")
print("--- Calculator app ----- ")
while True:
print("1. Enter 1 to add")
print("2. Enter 2 to subtract")
print("3. Enter 3 to multiply")
print("4. Enter 4 to divide")
print("5. Enter 5 to exit\n")
choice = input("Choose your option: ")
if choice == '5':
print("thanks for using! Good Bye! ")
break
num1 = float(input("Enter the first number: "))
num2 = float(input("Enter the second number: "))
if choice == '1':
add(num1, num2)
elif choice == '2':
sub(num1, num2)
elif choice == '3':
mul(num1, num2)
elif choice == '4':
div(num1, num2)
else:
print("Invalid Input!")

👍 like the video!
Try it and comment what do you want next project be?


Auf dieser Seite können Sie das Online-Video Build a Python Calculator App | Python Project for Beginners | GaneshRawatz mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer GANESH RAWAT 04 Juni 2025 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 139 Mal angesehen und es wurde von 7 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!