Advertisement
Guest User

Untitled

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