What’s happening here?
fruits is a list of 5 string items.
fruits[1:3] is list slicing. It means:
-
Start at index 1 ('Py')
-
Go up to but not including index 3 ('CPython')
-
So it includes:
'Py' (index 1)
'Anaconda' (index 2)
It stops before index 3.
✅ Output:
0 Comments:
Post a Comment