def select_city(): suffix = "" for j in range(City.get_max_index() + 1): suffix += "\n\t" + str(j) + ": " + City.city_allowed[j] + " " prompt = "Choose the \"city\" (aka \"ruota\"): " + suffix + "\n" city_index = LottoController.check_input(prompt, min_=City.get_min_index(), max_=City.get_max_index()) a_city = City(city_index) """range_ = range(len(City.city_allowed)) city_value = LottoController.check_input(prompt, 0, len(City.city_allowed) - 1) city_value = False while not city_value: try: city = City(city_value) # print("city***", city) city_value = True except: city_value = check_input(prompt, 0, len(City.city_allowed) - 1) """ return a_city