-
Notifications
You must be signed in to change notification settings - Fork 0
/
Simple_ChatBot.py
63 lines (47 loc) · 1.53 KB
/
Simple_ChatBot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
def greet(bot_name, birth_year):
print('Hello! My name is ' + bot_name + '.')
print('I was created in ' + birth_year + '.')
def remind_name():
print('Please, remind me your name.')
name = input()
print('What a great name you have, ' + name + '!')
def guess_age():
print('Let me guess your age.')
print('Enter remainders of dividing your age by 3, 5 and 7.')
rem3 = int(input())
rem5 = int(input())
rem7 = int(input())
age = (rem3 * 70 + rem5 * 21 + rem7 * 15) % 105
print("Your age is " + str(age) + "; that's a good time to start programming!")
def count():
print('Now I will prove to you that I can count to any number you want.')
num = int(input())
curr = 0
while curr <= num:
print(curr, '!')
curr = curr + 1
def test():
print("Let's test your programming knowledge.")
q1 = """
Why do we use methods?
1. To repeat a statement multiple times.
2. To decompose a program into several small subroutines.
3. To determine the execution time of a program.
4. To interrupt the execution of a program."""
list_of_question = [q1,2]
print(q1)
while True:
a1 = int(input())
if a1 != 2:
print("Please, try again.")
else:
print("Completed, have a nice day!")
break
def end():
print('Congratulations, have a nice day!')
greet('Aid', '2020') # change it as you need
remind_name()
guess_age()
count()
test()
end()