Advertisement
GCK

GCK/ Slicing function

GCK
Sep 25th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. teams = ["WOLVES", "OWLS", "PANTHERS", "BEARS", "DRAGONS"]
  2. team_short=[]
  3.  
  4.  
  5. def shorten():
  6.     for items in teams:
  7.         team_short.append(items[:3])
  8.     return team_short
  9.  
  10. team_short=shorten()
  11. print(team_short)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement