Hello,
I would need your help to sort the copy of a list without modifying the initial list.
for example, when I create a copy of the C1 list. Then I sort this copy. Both lists are unfortunately sorted.
I would need your help to sort the copy of a list without modifying the initial list.
for example, when I create a copy of the C1 list. Then I sort this copy. Both lists are unfortunately sorted.
def tri_ins(t):
for k in range(1,len(t)):
temp=t[k]
j=k
while j>0 and temp<t[j-1]:
t[j]=t[j-1]
j-=1
t[j]=temp
return t
C1=[7,3,6,5,4,2,1]
C2=C1
tri_ins(C2)I know it's possible using the "sort" function but unfortunately I'm not allow to use it.
C1=[7,3,6,5,4,2,1] C2=C1 C2=sorted(C1)Thank you for your help.
