Advertisement
Guest User

Bot1

a guest
Jun 17th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. print ('Hi, I am your personal Bot.')
  2. bot_name = 'Marvin'
  3. print('My name is ' + bot_name)
  4. users_name = input('What is your name? :')
  5. print ('Hi ' + users_name + ', good to meet you!')
  6. print()
  7.  
  8. #receiving inputs
  9. print('Let\'s do some maths first')
  10. print()
  11. input1 = input('What is the first number? :')
  12. input2 = input('What is the second number? :')
  13. input3 = input('What is the third number? :')
  14. print()
  15.  
  16. #adding two numbers together
  17. number1 = int(input1)
  18. number2 = int(input2)
  19. number3 = int(input3)
  20. result1 = number1 + number2
  21. output1 = str(result1)
  22. print('The result of ' + input1 + ' added to ' + input2 + ' is ' + output1)
  23. print()
  24.  
  25. #adding three numbers together
  26. result2 = number1 + number2 + number3
  27. output2 = str(result2)
  28. print('The result of ' + input1 + ' added to ' + input2 + ' and ' + input3 + ' is ' + output2)
  29. print()
  30.  
  31. #subtracting numbers
  32. result3 = number1 - number2
  33. output3 = str(result3)
  34. print('The result of ' + input1 + ' minus ' + input2 + ' is ' + output3)
  35. print()
  36.  
  37. #calculate the area of a square
  38. result4 = number1 * number1
  39. output4 = str(result4)
  40. print('The area of a square with a side length of ' + input1 + 'm. Is ' + output4 + 'm2.')
  41. print()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement