-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtextbot.py
More file actions
58 lines (43 loc) · 1.55 KB
/
Copy pathtextbot.py
File metadata and controls
58 lines (43 loc) · 1.55 KB
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
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("What is the purpose break statement in python?")
print("1. Terminates the loop statement and transfers execution to the statement immediately following the loop.")
print("2. Terminates the life on earth.")
print("3. Terminates the running script immediately.")
print("4. Breaks the chain of supply between manufacturers and distributors.")
real_answer = 1
user_answer = int(input())
while user_answer != real_answer:
print("Please, try again")
user_answer = int(input())
print('Noice choice mate!')
def end():
print('Congratulations, have a nice day!')
greet('Celsius', '1984') # change it as you need
remind_name()
guess_age()
count()
test()
end()