Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #slicing
- players = ['charles', 'martina', 'michael', 'florence', 'eli']
- print(players[0:3])
- #looping through slices
- players = ['charles', 'martina', 'michael', 'florence', 'eli']
- print("Here are the first three players on my team:")
- for player in players[:3]:
- print(player.title())
- #copying list
- my_foods = ['pizza', 'falafel', 'carrot cake']
- friend_foods = my_foods[:]
Add Comment
Please, Sign In to add comment