Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Hi, I am Eley, your personal bot.")
- command = input("How can I help? ")
- if command == "add" or command == "plus":
- 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)
- else:
- print("Sorry your entry is wrong.")
- command1 = input("Let's do a subtraction with the result of the sum: ")
- if command1 == "let's do it" or command1 == "all right":
- print("lets subract some numbers")
- input3 = input("Number 3> ")
- number3 = int(input3)
- number4 = int(output)
- print(number4)
- result1 = number3 - number4
- output1 = str(result1)
- print(input3 + " - " + output + " = " + output1)
- else:
- print("Sorry your entry is wrong, operations are not possible.")
- command2 = input("Let's continue with other operations such as multiply / divide: ")
- if command2 == "multiply":
- print("Let's multiply the result of the subtraction by a given number")
- input4 = input("Number 4> ")
- number5 = int(input4)
- number6 = int(output1)
- result2 = number5 * number6
- output2 = str(result2)
- print(input4 + " * " + output1 + " = " + output2)
- elif command2 == "divide":
- print("Let's divide the result of the subtraction by a given number")
- input4 = input("Number 4> ")
- number5 = int(input4)
- number6 = int(output1)
- result2 = number6 / number5
- output2 = str(result2)
- print(output1 + " / " + input4 + " = " + output2)
- else:
- print("Sorry I dont understand.")
Add Comment
Please, Sign In to add comment