Advertisement
ancestor_tunji

# length_counts_function

Mar 8th, 2020
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. # length_counts_function
  2. list_of_african_countries = ["nigeria", "angola", "ghana", "south africa", "libya"]
  3. def length_counts_function(list_of_african_countries):
  4. new = {}
  5. for list in list_of_african_countries:
  6. if len(list) in new:
  7. new[len(list)] +=1
  8. else:
  9. new[len(list)] = 1
  10. return new
  11. length_counts_function(list_of_african_countries)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement