Advertisement
BERKYT

Task for m-py-c

Sep 29th, 2022 (edited)
629
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | None | 0 0
  1. import random
  2.  
  3. collection = [random.randint(-100, 100) for _ in range(10)]
  4. print(f'{collection=}')
  5.  
  6. # min
  7. # task: Сделать из этого кода max
  8. # -----------------------------------
  9. min_num = collection[0]
  10.  
  11. for i in collection:
  12.     if min_num > i:
  13.         min_num = i
  14.  
  15. print(min_num)
  16. # -----------------------------------
  17.  
  18. # any
  19. # task: Сделать из этого кода all
  20. # -----------------------------------
  21. for i in collection:
  22.     if i:
  23.         print(True)
  24.         break
  25. # -----------------------------------
  26.  
  27. # sum
  28. # task: Написать код, который будет искать сумму коллекции
  29. # -----------------------------------
  30. pass
  31. # -----------------------------------
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement