Explanation of each step: my_list = [] creates an empty list. append() adds elements to the end of the list. insert(1, 15) inserts 15 at index 1 (second position, since Python uses 0-based indexing). extend([50, 60, 70]) adds multiple elements to the end of the list. pop() removes the last element (70 in this case). sort() arranges the list in ascending order. index(30) finds the position of 30 in the sorted list (which is 3 in this case).
-
Notifications
You must be signed in to change notification settings - Fork 0
Mkhambe234/python-assignment-2
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published