in this assignment, you will practice some of the basic commands to work with lists.
You will be given a list to start: starter_list = [3, 18, 2, 75, 8, 33]
- Append 123 to the list
- Example:
list.append(15)
adds 15 to the end oflist
- Example:
- Insert 12 into the list[2] spot
- Example:
list.insert(1, 'athenian')
insertsathenian
in the #1 spot
- Example:
- Remove 8 from the list
- Example:
list.remove('ball')
removes the string'ball'
from the list
- Example:
- Sort list in ascending order (smallest to largest)
- Example:
list.sort()
sorts from small to large,list.sort(reverse = True)
sorts large to small
- Example:
- Check if 33 is in the list
- Hint: use the keyword
in
!
- Hint: use the keyword
Note: Read the comments in my_code.py
for more instructions!