print(“Enter a list of numbers separated by spaces:”)

list = [int(s) for s in input().split()]

# your code goes here.

max = list[0]

for i in range(1, len(list)):

if list[i] > max:

max = list[i]

Location1 = list.index(max)

min = list[0]

for i in range(1, len(list)):

if list[i] < min:

min = list[i]

Location2 = list.index(min)

tmp = list(max)

list(max) = list(min)

list(min) = tmp

for x in range(len(list)):

print(list, end=" ")

I’ll put 3 4 5 1 2 and the output will be 3 4 1 2 5. However, I couldn’t reach to the output. Help meee!