Quick actions

cmd+k|ctrl+k

Navigation

Languages

List Slicing

Snippet info

Language

Python

Visibility

public

Author

aldenvidal25

Created

2025-08-27T10:43:30.318435Z

Updated

2025-08-27T10:43:30.318435Z

amazon_cart = [
'notebooks',
'sunglasses',
'toys',
'grapes'
]

amazon_cart[0] = 'laptop'
new_cart = amazon_cart[:] #this code created a new list
new_cart[0] = 'gum'
print(new_cart)
print(amazon_cart)
INFO