SHARE
TWEET

Untitled

a guest Aug 14th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. finished = False
  2.  
  3. print("Hi, I am Bob, your personal bot.")
  4. print("Let us get started")
  5. print()
  6. users_name = input("What should I call you ? ")#ask the user their name
  7. print("Nice to meet you " + users_name + " lets do some Maths ")
  8. print ()
  9. while finished == False:
  10.         command = input("Would you like to Add or Subtract ,multiply divide or get the Average today " +users_name + "? " )
  11.  
  12.         if command == "add" or command == "+" :
  13.             print ("Lets add some numbers then .")
  14.             input1 = input("First number to add is ")
  15.             input2 = input("Second number to add is ")
  16.             number1 =int(input1)
  17.             number2 =int(input2)
  18.             total = number1 + number2
  19.             output = str(total)
  20.             print (output)
  21.             ### Subtract ###
  22.         elif command == "subtract" or command == "-" or command == "minus" :
  23.             print ("Ok cool lets subtract some numbers")
  24.             input1 = input("First number to subtract is ")
  25.             input2 = input("Second number to subtract is ")
  26.             number1 =int(input1)
  27.             number2 =int(input2)
  28.             total = number1 - number2
  29.             output = str(total)
  30.             print ("your numers "+input1 + " and "+input2+" were subtracte to get you "+output+ ".")
  31.                 ### Average ###
  32.         elif command == "average" or command == "Average":
  33.                 how_many = input("How many numbers> ")
  34.                 how_many = int(how_many)
  35.                 total = 0
  36.                 for number_count in range (how_many):
  37.                     number = input("what is the number" +str(number_count)+ ">")
  38.                     total = total + int(number)
  39.                 result = total / how_many
  40.                 print ("the average is "+str(result) + ".")    
  41.                 ### Multiply ###
  42.         elif command == "*" or command == "multiply" or command == "x" :
  43.             print ("lets multiply some numbers then so")
  44.             input1 = input("First number to multiply is ")
  45.             input2 = input("Second number to miltply is ")
  46.             number1 =int(input1)
  47.             number2 =int(input2)
  48.             total = number1 * number2
  49.             output = str(total)
  50.             print ("your numbers "+input1 + " and "+input2+" were multplyed to get you "+output+ ".")
  51.         elif command == "/" or command == "divide" or command == "--" :
  52.             print ("lets divide some numbers then so")
  53.             input1 = input("First number to divide is ")
  54.             input2 = input("Second number to divide is ")
  55.             number1 =int(input1)
  56.             number2 =int(input2)
  57.             total = number1 / number2
  58.             output = str(total)
  59.             print ("your numbers "+input1 + " and "+input2+" were divide to get you "+output+ ".")      
  60.         elif command == "bye" :
  61.             finished = True
  62.             print ("ok good bye")
  63.         else:
  64.             print ("Sorry i dont know that one ")
  65.                
  66.         #print ("ok what will we do next ")    
  67.  
  68.         #colour = input("pick a colour ")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top