D34d10ck3d

Untitled

Apr 16th, 2020
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. x = int(input('Введите целые неотрицательные числа, '
  2. 'для завершения введите 0:\n>> '))
  3. lst = []
  4. while x != 0:
  5. lst.append(x)
  6. x = int(input('>> '))
  7. length = len(lst)
  8. print('Количество членов последовательности:', length)
  9.  
  10. choise = int(input("Операция: "))
  11. if choise == 1:
  12. print(sum(lst))
  13. elif choise == 2:
  14. print(min(lst))
  15. elif choise == 3:
  16. cnt_chet = len(list(filter(lambda x: x%2 == 0, lst)))
  17. print(cnt_chet, length - cnt_chet)
  18. else:
  19. print('Error')
Advertisement
Add Comment
Please, Sign In to add comment