Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. FRIENDS = ['Серёга', 'Соня', 'Дима', 'Алина', 'Егор']
  2.  
  3. def print_friends_count(friends_count):
  4. if friends_count == 1:
  5. print('У тебя 1 друг')
  6. elif 2 <= friends_count <= 4:
  7. print('У тебя ' + str(friends_count) + ' друга')
  8. elif friends_count >= 5:
  9. print('У тебя ' + str(friends_count) + ' друзей')
  10.  
  11. def process_query(query):
  12. if query == 'Сколько у меня друзей?':
  13. print_friends_count()
  14. else:
  15. print('<неизвестный запрос>')
  16. print("Привет, я Анфиса!")
  17. count = len(FRIENDS)
  18. print_friends_count(count)
  19.  
  20. process_query('Сколько у тебя друзей?')
  21. process_query('Как меня зовут?')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement