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

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

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

Send Multiple Emails From Excel | Send Bulk Mail from Excel Sheet with Attachment in One Click

Send Multiple Emails From Excel | Send Bulk Mail from Excel Sheet with Attachment in One Click Download VBA Code Notepad file - Click here D...

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