Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x = int(input('Введите целые неотрицательные числа, '
- 'для завершения введите 0:\n>> '))
- lst = []
- while x != 0:
- lst.append(x)
- x = int(input('>> '))
- length = len(lst)
- print('Количество членов последовательности:', length)
- choise = int(input("Операция: "))
- if choise == 1:
- print(sum(lst))
- elif choise == 2:
- print(min(lst))
- elif choise == 3:
- cnt_chet = len(list(filter(lambda x: x%2 == 0, lst)))
- print(cnt_chet, length - cnt_chet)
- else:
- print('Error')
Advertisement
Add Comment
Please, Sign In to add comment