Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Asks for command
- command = input("How can I help you?>")
- #If was answered substract
- if command == 'substract':
- print("Lets substract some numbers")
- input1 = input("Number 1> ")
- input2 = input("Number 2> ")
- number1 = int(input1)
- number2 = int(input2)
- result = number1 - number2
- output = str(result)
- print(input1 + ' - ' + input2 + ' = ' + output)
- #If was answered add
- elif command == 'add':
- print("lets add some numbers")
- input1 = input("Number 1> ")
- input2 = input("Number 2> ")
- number1 = int(input1)
- number2 = int(input2)
- result = number1 + number2
- output = str(result)
- print(input1 + ' + ' + input2 + ' = ' + output)
- #If divide was answered
- elif command == 'divide':
- print("lets divide some numbers")
- input1 = input("Number 1> ")
- input2 = input("Number 2> ")
- number1 = int(input1)
- number2 = int(input2)
- result = number1 / number2
- output = str(result)
- print(input1 + ' / ' + input2 + ' = ' + output)
- #If divide was answered
- elif command == 'multiply':
- print("lets multiply some numbers")
- input1 = input("Number 1> ")
- input2 = input("Number 2> ")
- number1 = int(input1)
- number2 = int(input2)
- result = number1 * number2
- output = str(result)
- print(input1 + ' x ' + input2 + ' = ' + output)
- #If a different option have been chosen
- else:
- print("sorry I dont understand")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement