Guest User

Untitled

a guest
Nov 22nd, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #slicing
  2. players = ['charles', 'martina', 'michael', 'florence', 'eli']
  3. print(players[0:3])
  4.  
  5. #looping through slices
  6. players = ['charles', 'martina', 'michael', 'florence', 'eli']
  7. print("Here are the first three players on my team:")
  8. for player in players[:3]:
  9. print(player.title())
  10.  
  11. #copying list
  12. my_foods = ['pizza', 'falafel', 'carrot cake']
  13. friend_foods = my_foods[:]
Add Comment
Please, Sign In to add comment