Generation

generate functionMon, 06 Mar 2023

create a list with 7 cities, remove the vowels out of city names,

cities = ['provo', 'orlando', 'austin', 'new york', 'chicago', 'dallas', 'houston'] def remove_vowels(cities_list): new_list = [] for city in cities_list: city = city.replace('a', '') city = city.replace('e', '') city = city.replace('i', '') city = city.replace('o', '') city = city.replace('u', '') new_list.append(city) return new_list print(remove_vowels(cities))

Questions about programming?Chat with your personal AI assistant