Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x = [[1,2,3,4,5],[21,22,23,24,25],[31,32,33,34,35]]
- y = [0,0,0]
- z = [0,0,0,0,0]
- def first():
- print(x[0])
- print(x[0][2])
- print(x[2][1:3])
- print(x[0][::2])
- def second():
- for i in range(len(x)):
- y[i] = sum(x[i]) / len(x[i])
- print(y)
- def third():
- for i in range(len(x[0])):
- for j in range(3):
- z[i] += x[j][i]
- z[i] /= 3
- print([int(i * (10 ** 2)) / (10.0 ** 2) for i in z])
- first()
- second()
- third()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement