Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This is my program
- # Roland Beton
- print("Hi, I am Marvin, your personal bot. V2")
- users_name = input("Please enter your name: ")
- print("Hi there "+ users_name)
- todo = input("What would you like to do [add, multiply, subtract, divide]?: ")
- if todo == "add" or todo =="Add" or todo == "Plus":
- print("Lets add some numbers")
- input1 = int(input("Number 1> "))
- input2 = int(input("Number 2> "))
- result = input1 + input2
- print(str(input1) +"+"+ str(input2) +"="+ str(result))
- elif todo == "multiply" or todo == "Multiply":
- print("Lets multiply some numbers")
- input1 = int(input("Number 1> "))
- input2 = int(input("Number 2> "))
- result = input1 * input2
- print(str(input1) +"*"+ str(input2) +"="+ str(result))
- elif todo == "subtract" or todo == "Subtract":
- print("Lets subtract some numbers")
- input1 = int(input("Number 1> "))
- input2 = int(input("Number 2> "))
- result = input1 - input2
- print(str(input1) + "-" + str(input2) + "=" + str(result))
- elif todo == "divide" or todo == "Divide":
- print("Lets divide some numbers")
- input1 = int(input("Number 1> ")) # type: int
- input2 = int(input("Number 2> "))
- result = input1 / input2
- print(str(input1) + "/" + str(input2) + "=" + str(result))
- else:
- print("Lets square a number")
- input1 = int(input("Number > "))
- result = input1 * input1
- print(str(input1) + "*" + str(input1) + "=" + str(result))
- print('Goodbye :)')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement