Advertisement
elena_gancedo

Loop_my_bot

Jul 9th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. finished = False
  2. while finished == False:
  3.     print("Hi, I am Eley, your personal bot.")
  4.     command = input("If you want to add two numbers write 'add' or 'plus': ")
  5.     if command == "add" or command == "plus":
  6.         print("Let's add some numbers:")
  7.         input1 = input("Number 1> ")
  8.         input2 = input("Number 2> ")
  9.         number1 = int(input1)
  10.         number2 = int(input2)
  11.         result = number1 + number2
  12.         output = str(result)
  13.         print("The result of the sum: " + input1 + " + " + input2 + " = " + output)
  14.     elif command == "bye" or command == "stop":
  15.         finished = True
  16.     else:
  17.         print("Sorry your entry is wrong.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement