• API
• FAQ
• Tools
• Archive
SHARE
TWEET # bot3 a guest Aug 19th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. print("Hello, I am Lian, your personal bot")
2. user_name=input("What's your name?")
3. print("Nice to meet you " + user_name + "." + " I hope that our cooperation will be fruitful.")
4. q1 = input("What do you want to do? Practice adding, substraction, calculate a lozenge surface area, divide or multiply?")
5. if q1 == "adding":
7.     number1=int(input("Number 1"))
8.     number2=int(input("Number 2"))
9.     result = number1 + number2
10.     print(str(number1) + "+" + str(number2) + "=" + str(result))
11. elif q1 == "substraction":
12.     print("What about substraction?")
13.     number3=int(input("Minuend"))
14.     number4=int(input("Substrahend"))
15.     result2 = number3 - number4
16.     print(str(number3) + "-" + str(number4) + "=" + str(result2))
17. elif q1 == "calculate a lozenge surface area":
18.     print("Let's calculate a lozenge surface area!")
19.     number5=int(input("the length of the base"))
20.     number6=int(input("Height"))
21.     result3 = number5/2 * number6
22.     print(str(number5) + "/2" + " * " + str(number6) + " =" + str(result3))
23. elif q1 == "divide":
24.     print("Time for some divide problems!")
25.     number7=int(input("dividend"))
26.     number8=int(input("divider"))
27.     result4 = number7/number8
28.     print(str(number7) + " / " + str(number8) + " = " + str(result4))
29. elif q1 == "multiply":
30.     print("Yay, let's multiplay!")
31.     number9=int(input("First number"))
32.     number10=int(input("Second number"))
33.     result5 = number9*number10
34.     print(str(number9)  + " * " + str(number10) + " = " + str(result5))
35. else:
36.     print("Sorry, I don't understand")
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.

Top