Run from the terminal or import into your own code.
Run with or without arguments.
python city_namer.py
Generates 1 city name by default.
python city_namer.py 5
Generates 5 city names.
Call with or without arguments.
from city_namer import city_names
for city in city_names():
print(city)
Generates 1 city name by default.
from city_namer import city_names
for city in city_names(5):
print(city)
Generates 5 city names.
Note that the number of city names available is limited by the number of words ending with "city", and beyond this limit specifying a higher number will not generate more words.