I have this function to simulate reverse() in python:
My_list = [[1, 3, "s"], 2, 2, 3, 4, 2]
def listRev(list):
list=list[::-1]
print list
listRev(My_list)
print My_list
The function gives me correct reversed list but I expect when I print My_list in the last line, the code print reversed My_list not My_list itself. How can I solve my problem?
listas a veriable name is a bad idea.