Jun-30-2022, 02:15 PM
I simplified my code and used the forum standards.
Why is the item "a" removed from list2 when the item "a" is removed from list1?
Why is the item "a" removed from list2 when the item "a" is removed from list1?
list1=["a","b","c"] list2=list1 list1.remove("a") print("list1 = ",list1) print("list2 = ",list2)Code Output:
Output:list1 = ['b', 'c']
list2 = ['b', 'c']