Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def count_of_a_function(list): #Declares a count_of_a_functtion variable
- m = [] #Creates an empty list
- g = 'a'
- 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
- b = j.count(g)
- m.append(b)
- print(m)
- count_of_a_function(['adidas','adrenaline','abibat']) #Calls the count_of_a_function function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement