Advertisement
GamerBhai02

1. List

Jan 13th, 2025
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | Source Code | 0 0
  1. list = [12,34,56,78,23,45,67,89,101]
  2. print(list)
  3. list.append(202)
  4. list.append(303)
  5. list.append(404)
  6. print(list)
  7. list.insert(5,15)
  8. print(list)
  9. list.insert(2,25)
  10. print(list)
  11. list.remove(67)
  12. print(list)
  13. list.reverse()
  14. print(list)
  15. print(list[7])
  16. print(list[4:8])
  17. print(list[:5])
  18. print(list[::3])
  19. print(list.index(90)) #Value not present
Tags: Assignment 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement