distance[i] = 2000
def uz_shop_view(message: telebot.types.Message) -> None:
if message.location is not None:
lon: float = message.location.longitude
lat: float = message.location.latitude
distance: List[...] = []
for loc in STORES:
result: float = geodesic(
(loc['lons'], loc['lats']), (lon, lat)).meters
distance.append(result)
counter = len(distance)
while counter > 0:
i = distance.index(min(distance))
print(i)
distance[i] = 10 ** 100
counter -= 1
bot.send_venue(message.chat.id,
STORES[i]['lons'],
STORES[i]['lats'],
STORES[i]['title'],
STORES[i]['address'])
elif message.location is None:
bot.reply_to(message, "Отправь местоположение!")
вот код.