ryap14 / hello-world

helloworld
0 stars 0 forks source link

list of python codes created. #1

Open ryap14 opened 8 months ago

ryap14 commented 8 months ago

list of python codes created.

ryap14 commented 8 months ago

create a function that when given a list of strings will return a list of strings that contains the characters 'a' and 'e'

import re words_list = ['ramen', 'rAmen', 'aery', 'ear', 'ball', 'cat', 'café']

for x in words_list: if re.search('a' and 'e' , x): list = [x] lowercase = [x for x in list if x.islower()] newlist = lowercase print(*newlist, sep = '', end=" ") else: exit()