Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. #To overwrite element in a list
  2.  
  3. great_directors = ["Martin Scorsese", "Seven Spielberg", "Francis Ford Coppola"]
  4. great_directors[1] = "Michael Bay"
  5.  
  6. print(great_directors)
  7.  
  8. transformers = ["Optimus Primius", "Megatron", "Bumblebee", "Starscream"]
  9. transformers[2] = "Grimlock"
  10.  
  11. print(transformers)
  12.  
  13. camping_trip_supply = ["Socks", "Flashlight", "Tent", "Blanket"]
  14. camping_trip_supply[0] = "Food"
  15.  
  16. print(camping_trip_supply)
  17.  
  18. tech_companies = ["Google", "Microsoft", "Blackberry", "IBM", "Yahoo"]
  19. tech_companies[1:4] = [Facebook", "Apply"]
  20.  
  21. print(tech_companies)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement