SHARE
TWEET

Untitled

a guest Feb 22nd, 2020 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top