Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print ('Hi, I am your personal Bot.')
- bot_name = 'Marvin'
- print('My name is ' + bot_name)
- users_name = input('What is your name? :')
- print ('Hi ' + users_name + ', good to meet you!')
- print()
- #receiving inputs
- print('Let\'s do some maths first')
- print()
- input1 = input('What is the first number? :')
- input2 = input('What is the second number? :')
- input3 = input('What is the third number? :')
- print()
- #adding two numbers together
- number1 = int(input1)
- number2 = int(input2)
- number3 = int(input3)
- result1 = number1 + number2
- output1 = str(result1)
- print('The result of ' + input1 + ' added to ' + input2 + ' is ' + output1)
- print()
- #adding three numbers together
- result2 = number1 + number2 + number3
- output2 = str(result2)
- print('The result of ' + input1 + ' added to ' + input2 + ' and ' + input3 + ' is ' + output2)
- print()
- #subtracting numbers
- result3 = number1 - number2
- output3 = str(result3)
- print('The result of ' + input1 + ' minus ' + input2 + ' is ' + output3)
- print()
- #calculate the area of a square
- result4 = number1 * number1
- output4 = str(result4)
- print('The area of a square with a side length of ' + input1 + 'm. Is ' + output4 + 'm2.')
- print()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement