├── README.md └── SimpleChattyBot.py /README.md: -------------------------------------------------------------------------------- 1 | # HyperSkill 2 | final training projects 3 | -------------------------------------------------------------------------------- /SimpleChattyBot.py: -------------------------------------------------------------------------------- 1 | def greet(bot_name, birth_year): 2 | print('Hello! My name is ' + bot_name + '.') 3 | print('I was created in ' + birth_year + '.') 4 | 5 | 6 | def remind_name(): 7 | print('Please, remind me your name.') 8 | name = input() 9 | print('What a great name you have, ' + name + '!') 10 | 11 | 12 | def guess_age(): 13 | print('Let me guess your age.') 14 | print('Enter remainders of dividing your age by 3, 5 and 7.') 15 | 16 | rem3 = int(input()) 17 | rem5 = int(input()) 18 | rem7 = int(input()) 19 | age = (rem3 * 70 + rem5 * 21 + rem7 * 15) % 105 20 | 21 | print("Your age is " + str(age) + "; that's a good time to start programming!") 22 | 23 | 24 | def count(): 25 | print('Now I will prove to you that I can count to any number you want.') 26 | 27 | num = int(input()) 28 | curr = 0 29 | while curr <= num: 30 | print(curr, '!') 31 | curr = curr + 1 32 | 33 | 34 | def end(): 35 | print('Congratulations, have a nice day!') 36 | 37 | 38 | def test(): 39 | print("Let's test your programming knowledge.") 40 | print("Why do we use methods?") 41 | print("1. To repeat a statement multiple times.") 42 | print("2. To decompose a program into several small subroutines.") 43 | print("3. To determine the execution time of a program.") 44 | print("4. To interrupt the execution of a program.") 45 | answer = int(input()) 46 | if answer == 2: 47 | pass 48 | else: 49 | while answer != 2: 50 | print("Please, try again.") 51 | answer = int(input()) 52 | 53 | 54 | greet('Victim', '2022') 55 | remind_name() 56 | guess_age() 57 | count() 58 | test() 59 | end() --------------------------------------------------------------------------------