How Make a Simple Calculaor in Python

 


How Make a Simple Calculaor in Python

Make a Simple Calculator Using IF, Elif and Else

 

while True:
    choice = input(
"Choose Operator..+, -, *, / or Q or q…")
   
if choice=="Q" or choice=="q":
       
break
   
num1 = int(input("Enter first number: "))
    num2 = int(input(
"Enter second number: "))

   
if choice =="+":
        print(num1+num2)
   
elif choice=="-":
        print(num1-num2)
   
elif choice=="*":
        print(num1*num2)
   
elif choice == "/":
        print(num1 / num2)
   
else:
        print(
"Invalid choice...")



<<Previous                                                  Next>>

कोई टिप्पणी नहीं

टिप्पणी: केवल इस ब्लॉग का सदस्य टिप्पणी भेज सकता है.

Excel to WhatsApp automation

Send Whatsapp Custom Message Using MS Excel | Excel to Whatsapp Step-by-Step Guide Download Practice file -  Click Here The Secret Behind Wh...

Blogger द्वारा संचालित.