Advertisement
elena_gancedo

Short list

Aug 9th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. animals = ["WOLVES", "OWLS", "PANTHERS", "BEARS", "DRAGONS"]
  2. animals_3letters = []
  3. for i in animals:
  4.     animals_3letters.append(i[0:3])
  5. print("Short list: ", animals_3letters)
  6. # Another way to print the short list
  7. string = animals_3letters
  8. string_animals = string
  9. print ("Short list: "+ str(string)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement