arr = [int(i) for i in input().split()]
new_arr = []
for i in arr:
if i>=-5 and i<=10:
new_arr.append(i**2)
else:
new_arr.append(i)
[print(i, end=" ") for i in new_arr]
Краткий гайд:
arr = [int(i) for i in input().split()]
new_arr = []
for i in arr:
if i>=-5 and i<=10:
new_arr.append(i**2)
else:
new_arr.append(i)
[print(i, end=" ") for i in new_arr]
Краткий гайд:
arr - исходный списокnew_arr - измененный список