Advertisement
newb_ie

Untitled

Sep 3rd, 2021
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. x = [[1,2,3,4,5],[21,22,23,24,25],[31,32,33,34,35]]
  2. y = [0,0,0]
  3. z = [0,0,0,0,0]
  4.  
  5. def first():
  6. print(x[0])
  7. print(x[0][2])
  8. print(x[2][1:3])
  9. print(x[0][::2])
  10.  
  11. def second():
  12. for i in range(len(x)):
  13. y[i] = sum(x[i]) / len(x[i])
  14. print(y)
  15.  
  16. def third():
  17. for i in range(len(x[0])):
  18. for j in range(3):
  19. z[i] += x[j][i]
  20. z[i] /= 3
  21. print([int(i * (10 ** 2)) / (10.0 ** 2) for i in z])
  22.  
  23. first()
  24. second()
  25. third()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement