Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Scott the calculator
- #Main functions are subtract, divide, multiplication and addition
- print("Hi, I am Scott, your personal bot.")
- command = input("How can I help? Choose from Add, Sub, Multi or Div ")
- if command == "add" or command == "Add":
- print("lets add some numbers")
- input1 = input("Number 1> ")
- input2 = input("Number 2> ")
- number1 = int(input1)
- number2 = int(input2)
- result = number1 + number2
- output = str(result)
- print(input1 + " + " + input2 + " = " + output)
- elif command == "sub" or command == "Sub":
- print("lets subtract some numbers")
- input1 = input("Number 1> ")
- input2 = input("Number 2> ")
- number1 = int(input1)
- number2 = int(input2)
- result = number1 - number2
- output = str(result)
- print(input1 + " - " + input2 + " = " + output)
- elif command == "Multi" or command == "multi":
- print("lets subtract some numbers")
- input1 = input("Number 1> ")
- input2 = input("Number 2> ")
- number1 = int(input1)
- number2 = int(input2)
- result = number1 * number2
- output = str(result)
- print(input1 + " + " + input2 + " = " + output)
- elif command == "Div" or command == "div":
- print("lets subtract some numbers")
- input1 = input("Number 1> ")
- input2 = input("Number 2> ")
- number1 = int(input1)
- number2 = int(input2)
- result = number1 / number2
- output = str(result)
- print(input1 + " / " + input2 + " = " + output)
- else:
- print("Sorry, I don't understand")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement