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

30 Days Of Python

12 мая 2022
2022-05-12×
12 мая 2022
Please can someone help with with the solution to day 10, exercise level 30, number 3 (I, II, III)
I can't find the total number of languages, most spoken languages and most populated countries using for loop
How do I compare length of two variables
J
Should I use the assignment operator, or the greater than or less than or do we have to use if else.
T
id 5386240094Please can you share with me the complete solution for this.... I mean the full screen so I can study
#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)
Календарь: май 2022
ПнВтСрЧтПтСбВс1422314105961072891031112121113214615616117131811972032112252392420252627281293031
Архив по месяцам
Открыть в Telegram Каталог площадок Искать в ChatCrawler

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

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