Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print ("Choose what you want to do - add, subtract, multiply or divide.")
- select = input (">>")
- if select =="add" or select == "subtract" or select == "multiply" or select == "divide":
- print("What's the first number?")
- no1 = input (">>")
- number1 = int(no1)
- print("What's the second number?")
- no2 = input (">>")
- number2 = int(no2)
- else:
- print("I don't know this function. Bye.")
- if select == "add":
- Addresult = number1+number2
- Addoutput = str(Addresult)
- print (no1+"+"+no2+"="+Addoutput)
- print ("bye")
- elif select == "subtract":
- Subtractresult = number1-number2
- Subtractoutput = str(Subtractresult)
- print (no1+"-"+no2+"="+Subtractoutput)
- print ("bye")
- elif select == "multiply":
- Mulresult = number1*number2
- Muloutput = str(Mulresult)
- print (no1+"*"+no2+"="+Muloutput)
- print ("bye")
- elif select == "divide":
- Divresult = number1/number2
- Divoutput = str(Divresult)
- print (no1+"/"+no2+"="+Divoutput)
- print ("bye")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement