Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Hi, I am Marvin, your personal bot.")
- users_name = ("Leah")
- print("Lets get started " + users_name )
- command = input("How can I help? ")
- if command == "add":
- print("lets add some numbers")
- input1 = input("Number 1> ")
- input2 = input("Number 2> ")
- number1 = int(input1)
- number2 = int(input2)
- result = number1 + number2
- # str are text vairables
- output = str(result)
- print(input1 + " + " + input2 + " = " + output)
- # elif means else if
- elif command == "subtract":
- print("Let's 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 == "multiply":
- print("Let's do some mulitplication")
- input1 = input("Number 1> ")
- input2 = input("Number 2> ")
- number1 = int(input1)
- number2 = int(input2)
- result = number1 * number2
- output = str(result)
- print(input1 + "x" + input2 + "=" + output)
- elif command == "divide":
- print("Ok, let's do some division")
- input1 = input("Number 1> ")
- input2 = input("Number 2> ")
- number1 = int(input1)
- number2 = int(input2)
- result = number1 / number2
- output = str(result)
- print(input1 + "/" + input2 + "=" + output)
Add Comment
Please, Sign In to add comment