Last active
October 13, 2020 10:19
-
-
Save gkfarwaha/b3b2bc836725f69c3ccfc783c3fc9549 to your computer and use it in GitHub Desktop.
CALCULATOR
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#THIS THE BASIC CALCULATOR WHICH OPTIONS TO SELECT FROM. | |
print("WELCOME TO THE PYTHON CALCULATOR") | |
a= int( input("enter your FIRST NO. ", )) | |
b= int(input("enter your SECOND NO. ", )) | |
print("SELECT M FOR MULTIPLICATION OF TWO NOS. \nSELECT D FOR DIVISION OF TWO NOS. \nSELECT A FOR ADDITION OF TWO NOS.\nSELECT S FOR SUBSTRACTION OF TWO NOS.") | |
x=input("ENTER YOUR CHOICE ",) | |
print(x) | |
if x == "m" or x == "M" : | |
print(a*b) | |
elif x == "d" or x == "D": | |
print(a/b) | |
elif x == "A" or x == "a": | |
print(a + b) | |
elif x == "s" or x == "S": | |
print(a-b) | |
else: | |
print("INVALID INPUT \nKINDLY SELECT FROM THE FOLLOWING \nA: ADDITION\nS: SUBSTRACTION\nD: DIVISION\nM: MULTIPLICATION") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment