def sorted():
print(numList)
sortedList=numList
sortedList.sort()
print(numList)
print(sortedList)
Result:
[4,1,9,16,25]
[1,4,9,16,25]
[1,4,9,16,25]
Actually, I just sort the "sortedList" only, but result shows it sorted numList too. may I know the reason and solution.