generate functionWed, 01 Mar 2023

A list of named cities is entered in one line separated by a space. Determine that in this list all cities have more than 5 characters. Implement a program using a loop during a statement break. Print YES if the statuses and NO - available.

def determine_cities_longer_than_5_chars(cities): for city in cities.split(): if len(city) <= 5: print('NO') return print('YES') cities = input() determine_cities_longer_than_5_chars(cities)

Questions about programming?Chat with your personal AI assistant