22 Nov
22Nov

Source code -

name = input("Enter your name:")

print("Hi,",name)

print("Welcome to a simple calculator made by Linux & Windows Tech")

print("1. Adition")

print("2. Subtraction")

print("3. Multiply")

print("4. Division")

choice = input("Enter your choice (1/2/3/4):")

num1 = float(input("Enter the first number:"))

num2 = float(input("Enter the second number:"))

if choice == '1':   

add = num1 + num2   

print("The sum is:",add)

elif choice == '2':   

 subtraction = num1 - num2    

print("The difference is:",subtraction)

elif choice == '3':   

 multiply = num1 * num2   

 print("The product is:",multiply)

elif choice == '4':    

division = num1 / num2    

print("The remainder is:",division)

else:   

 print("Invalid operation, try again!")     

Comments
* The email will not be published on the website.
I BUILT MY SITE FOR FREE USING