-
Notifications
You must be signed in to change notification settings - Fork 0
/
Simple_Chatty_Bot
62 lines (44 loc) · 1.47 KB
/
Simple_Chatty_Bot
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
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.")
print("Why do we use methods?")
print("1. To repeat a statement multiple times.")
print("2. To decompose a program into several small subroutines.")
print("3. To determine the execution time of a program.")
print("4. To interrupt the execution of a program.")
while True:
answer = int(input())
if answer == 2:
break
else:
print("Please, try again")
print('Completed, have a nice day!')
def end():
print('Congratulations, have a nice day!')
greet('Alkuhs', '1999') # change it as you need
remind_name()
guess_age()
count()
test()
end()