Contact: aviboots(AT)netvision.net.il
39,938 questions
51,875 answers
573 users
lst = [1, 2, 3, 4, 5] lst_copy = lst.copy() print(lst_copy) ''' run: [1, 2, 3, 4, 5] '''
lst = [1, 2, 3, 4, 5] lst_copy = lst[:] print(lst_copy) ''' run: [1, 2, 3, 4, 5] '''
lst = [1, 2, 3, 4, 5] lst_copy = list(lst) print(lst_copy) ''' run: [1, 2, 3, 4, 5] '''
lst = [1, 2, 3, 4, 5] lst_copy = [i for i in lst] print(lst_copy) ''' run: [1, 2, 3, 4, 5] '''