Skip to content

Commit b46c399

Browse files
Update solutions.py
1 parent 5a2351a commit b46c399

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Beginers/ListsTuples/solutions.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@
1212
selecting from lists
1313
====================
1414
Given the list
15-
x = ['A', 'B', 'C']
15+
x = ['A', 'B', 'C', 'D', 'E']
1616
return the first item
1717
return the last item
18+
return the second last item ('D')
19+
return all elements up to the last i.e. ('A','B','C', 'D')
20+
return all elememtns which are not the first or the last i.e ('B','C','D')
1821
return the x reversed using indexing
1922
2023
selecting first items

0 commit comments

Comments
 (0)