Задать вопрос
  • Опечатка в задаче python?

    @sym04ka
    Тоже самое, вывод чутка поправил:
    favorite_places = {
        'andy james': ['new york city', 'chicago', 'boston', 'los angeles'],
        'akihiro daichi': ['fukuoka', 'kyoto', 'tokio'],
        'philip karlsen': ['bergen', 'oslo', 'bodo'],
    }
    for name, cities in favorite_places.items():
        print(f"{name.title()} favorite cities are", end='')
        index = len(cities)
        for city in cities:
            if index > 1:
                print(f" {city.title()}", end=',')
            else:
                print(f" {city.title()}", end='.\n')
            index -= 1
    Написано