Advertisement
Guest User

Untitled

a guest
Mar 30th, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. print("Hi, i am Nuras, your personal bot.")
  2. command = input("How can i help you >")
  3. if command == "add":
  4. print("Let's add some number")
  5. input1 = input("Number 1>")
  6. input2 = input("Number 2>")
  7. number1 = int(input1)
  8. number2 = int(input2)
  9. result = number1 + number2
  10. output = str(result)
  11. print(input1 + "+" + input2 + "=" + output)
  12.  
  13.  
  14. elif command == "average":
  15. how_many = input("How many numbers ?")
  16. how_many = int(how_many)
  17. total = 0
  18. for number_count in range(how_many):
  19. number = input("enter number " + str(number_count) + ">")
  20. total = total + int(number)
  21. result = total/how_many
  22. print("the average = " + str(result))
  23.  
  24. else:
  25. print("I am sorry i dont understand")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement