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>>

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

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

MS Excel to WhatsApp Bulk Message in single Click

Excel to WhatsApp Bulk Message VBA Code File Download VBA Note Pad File - Click here Download Excel Practice File - Click here Copy Code her...

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