ChatCrawlerпоиск по публичному Telegram Открыть приложение
3

30 Days Of Python

сообщение · 2022-05-12 09:52 UTC
T
Ответсообщение недоступно
#i language = [] for item in countries_info: for items in item['languages']: if items in language: continue else: language.append(items) print(language) print(len(language)) #ii lang_counter = {} for item in countries_info: for lang in item['languages']: if lang in lang_counter: lang_counter[lang] += 1 else: lang_counter[lang] = 1 popular_langs = sorted(lang_counter, key = lang_counter.get, reverse = True) top_10 = popular_langs[:10] print(top_10) # here we use a dictionary and we add item, we add the language as key and the numbers of the repeatation as value. # every time it see the language again it add to the number. #sorted : key---> it show how to sort and here we use the value to be sorted(numbers of repeat) #reverse = true ---> from most to least. #iii population = [] for item in countries_info: population.append(item['population']) most_pop = sorted(population, reverse = True) top_10 = most_pop[:10] print(top_10) most_10 = [] for i in top_10: for item in countries_info: if i == item["population"]: most_10.append(item['name']) print(most_10)

Все сообщения за 12 мая 2022 · Вся лента · оригинал в Telegram

Открыть в Telegram Каталог площадок Искать в ChatCrawler

Слепок открытой публичной ленты из поискового индекса ChatCrawler — «Google по публичному Telegram»; обновляется по мере обхода площадки. Время — UTC.

Только публичный контент, официальный API Telegram. О проекте · Вопросы · Чего мы не делаем · Убрать страницу из выдачи · Каталог