Advertisement
dprincef

Untitled

Feb 28th, 2020
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. def count_of_a_function(list): #Declares a count_of_a_functtion variable
  2.     m = [] #Creates an empty list
  3.     g = 'a'
  4.    
  5.     for j in list: # Implementation of a loop that checks for the amount of time  a appears in each element in the string and returns a list with the number
  6.         b  = j.count(g)
  7.         m.append(b)
  8.     print(m)
  9. count_of_a_function(['adidas','adrenaline','abibat']) #Calls the count_of_a_function function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement