Odpowiedź :
from random import randrange
tab = []
for i in range(26):
tab.append(randrange(-15, 51))
print("Zadanie 1. A")
for i in tab:
print(i, end=" ")
print("\nZadanie 1. B")
for i in tab:
if i % 7 == 0:
print(i)
print("Zadanie 1. C")
for i in tab:
if i % 5 == 0 and i % 2 == 0:
print(i)
print("Zadanie 1. D")
for i in tab:
if i > 18:
print(i)
print("Zadanie 1. E")
for i in tab:
print(i-3)
print("Zadanie 1. F")
for i in range(len(tab)):
if i%4==0:
print(tab[i])
print("Zadanie 1. G")
suma = 0
for i in tab:
suma+=i
print(suma)
print("Zadanie 1. H")
suma = 0
srednia = 0
for i in tab:
suma+=i
srednia = suma/len(tab)
print(srednia)
print("Zadanie 1. I")
suma = 0
for i in range(len(tab)):
if i%2==0:
suma += tab[i]
print(suma)
print("Zadanie 1. J")
suma = 0
for i in tab:
if i%2==0:
suma+=i
print(suma)