Advertisement
Guest User

Untitled

a guest
Mar 26th, 2020
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. def print_friends_count(friends_count, name=''): # добавьте новый аргумент
  2. if friends_count == 1:
  3. text = '1 друг'
  4. elif 2 <= friends_count <= 4:
  5. text = str(friends_count) + ' друга'
  6. elif friends_count >= 5:
  7. text = str(friends_count) + ' друзей'
  8. if name !='':
  9. print(text + ', ' + name)
  10. else:
  11. print(text)
  12.  
  13. # дальше код не меняйте
  14. print_friends_count(3, 'Артём')
  15. print_friends_count(friends_count=7, name='Марина')
  16. print_friends_count(6)
  17. print_friends_count(4, name='Настя')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement