Question: please code in python 3 arr = ['ae', 'anana', 'lolololol' , ' aaaaa', 'inkinka', 'playplay ' , 'fruit', 'cucumbers'] alpha = ['a', 'e' ] saved

please code in python 3

arr = ['ae', 'anana', 'lolololol', 'aaaaa', 'inkinka', 'playplay', 'fruit', 'cucumbers']

alpha = ['a', 'e' ]

saved = ['']

using arr and alpha, count how many a,c,e,s dose each element have.

for example,

anana must print out 3

because it have three a

while you are counting, at saved array, you must save top 3 elements that have highest number.

for example,

'ae', 'anana', 'lolololol', 'aaaaa', 'inkinka', 'playplay', 'fruit', 'not']

2 3 0 5 1 2 0 0

since aaaaa, anana have highest and ae and playplay have same number,

saved must have

saved = ['aaaaa', 'anana', 'ae', 'playplay']

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!