42. List Slicing Flashcards
1
Q
How do you do list slicing?
A
it is when you choose how much you want from a list
2
Q
How do you do list slicing when you have
amazon_cart = [
‘notebook’
‘sunglasses’,
‘food’
A
print(amazon_cart[0::2]
[‘notebook’, ‘toys’]
3
Q
How do you replace something in a list?
A
file_name_e[0] = ‘new name’
file nammee is like the name of the list, and 0 is the place where your old name is in