Advertisement
farrismp

Short names

Apr 30th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. teams = ["WOLVES", "OWLS", "PANTHERS", "BEARS", "DRAGONS"]
  2. # The new list to hold the short team names
  3. teams_short = []
  4. # For each entry in the teams list add first three Chars to short list
  5. for team in teams:
  6. teams_short.append(team[:3])
  7. # Print short list just to confirm the result.
  8. print(teams_short)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement