Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Hi, I am BoBo your personnal Bot!")
- print("How can I help?")
- #choisir l'opération
- op_name =input()
- # addition
- #test l'entrée
- if op_name == "add" or op_name == "Add" or op_name == "+" :
- print("It's time to add :)")
- #premier nombre
- input1 = int(input("give me a first number1"))
- #second nombre
- input2 = int(input("give me a second number2"))
- #addition
- result = int(input1 + input2)
- print ("the result is "+ str(result))
- #soustraction
- elif op_name == "subtract" or op_name == "Substract" or op_name == "-":
- print("It's time to substract :)")
- #entrée premier nombre
- input1 = int(input("give me a first number1"))
- #entrée second nombre
- input2 = int(input("give me a second number2"))
- #calcul soustraction
- result = int(input1 - input2)
- print ("the result is "+ str(result))
- elif op_name == "multiply" or op_name == "Multiply" or op_name == "x":
- print("It's time to multiply :)")
- #entrée premier nombre
- input1 = int(input("give me the first number1"))
- #entrée second nombre
- input2 = int(input("give me a second number2"))
- #calcul multiplication
- result = int(input1 * input2)
- print ("the result is "+ str(result))
- #autre
- else :
- print("Sorry, I can't help you! bye")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement