from random import randint
mass = [randint(-10, 10) for s in range(10)]
mx = mass[0]
for i, digit in enumerate(mass):
if digit > mx:
mx = digit
k = i
print(mass)
print('max =', mx, 'индекс =', k)
Объяснение:
print('max =', max(mass), 'индекс =', mass.index(max(mass)))
from random import randint
mass = [randint(-10, 10) for s in range(10)]
mx = mass[0]
for i, digit in enumerate(mass):
if digit > mx:
mx = digit
k = i
print(mass)
print('max =', mx, 'индекс =', k)
Объяснение:
from random import randint
mass = [randint(-10, 10) for s in range(10)]
print(mass)
print('max =', max(mass), 'индекс =', mass.index(max(mass)))