Ответ:
import random
massiv=[random.randint(-100,100) for i in range(100)]
new_massiv=[]
new_massiv.append((massiv[-1]+massiv[0]+massiv[1])/3)
for i in range(1,98):
new_massiv.append((massiv[i-1]+massiv[i]+massiv[i+1])/3)
new_massiv.append((massiv[0]+massiv[-2]+massiv[-1])/3)
print(massiv)
print(new_massiv)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
import random
massiv=[random.randint(-100,100) for i in range(100)]
new_massiv=[]
new_massiv.append((massiv[-1]+massiv[0]+massiv[1])/3)
for i in range(1,98):
new_massiv.append((massiv[i-1]+massiv[i]+massiv[i+1])/3)
new_massiv.append((massiv[0]+massiv[-2]+massiv[-1])/3)
print(massiv)
print(new_massiv)