[Answered ]-I m Using python countries library and want to list and print total states and cities of given country using python is it possible to do it

1👍

This is an example of how you can use pycountry:

import pycountry

def cities_in_country(country):
    list_ = []
    for region in pycountry.subdivisions.get(country_code=country):
        list_.append(region.name)
    return list_


print(cities_in_country("FR"))
👤fed

Leave a comment