12311k

Untitled

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