Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- collection = [random.randint(-100, 100) for _ in range(10)]
- print(f'{collection=}')
- # min
- # task: Сделать из этого кода max
- # -----------------------------------
- min_num = collection[0]
- for i in collection:
- if min_num > i:
- min_num = i
- print(min_num)
- # -----------------------------------
- # any
- # task: Сделать из этого кода all
- # -----------------------------------
- for i in collection:
- if i:
- print(True)
- break
- # -----------------------------------
- # sum
- # task: Написать код, который будет искать сумму коллекции
- # -----------------------------------
- pass
- # -----------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement