0
newlist="a,b,c"
list2=newlist.split(',')
finalList=list2[:]

How can I make this return the reversed list using while?

y=len(list2)-1
z=0
finalList[2]='X'
while z < len(list2):
    print(z,y)
    finalList[z]=list2[y]
    y-=1
    z+=1
return finalList
Helen
  • 89
  • 3
  • 9

0 Answers0