scipiguy

Programming 102: Team list slicing

Jun 25th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1. teams_short = []
  2. teams = ["WOLVES", "OWLS", "PANTHERS", "BEARS", "DRAGONS"]
  3.  
  4. for x in range(len(teams)):
  5.     item = teams[x]
  6.     teams_short.append(item[:3])
  7. print(teams_short)
Advertisement
Add Comment
Please, Sign In to add comment