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?
In questa pagina del sito puoi guardare il video online Build a Python Calculator App | Python Project for Beginners | GaneshRawatz della durata di ore minuti seconda in buona qualità , che l'utente ha caricato GANESH RAWAT 04 giugno 2025, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 139 volte e gli è piaciuto 7 spettatori. Buona visione!