# Conditional expressions

Hello!
It’s the first time I’m using Python and can’t find the right function for the question below. I’ve tried unsuccessfully in many ways.
QUESTION
From the dictionary (country with number of population) below I have to find a function that allows me to visualize the countries with a population < 50 millions of inhabitants.

Populations = {
“Allemagne” : 81,
“Italie” : 60,
“Suisse” : 8.7,
“Luxembourg”: 0.5,
“Belgique”: 11,
“France” : 67.5,
“Espagne” : 46
}

Could you help me?

Also use the code fences that you get to in the cog wheel menu </> item.

``````type or paste code here
``````
``````populations = {
“Allemagne” : 81,
“Italie” : 60,
“Suisse” : 8.7,
“Luxembourg”: 0.5,
“Belgique”: 11,
“France” : 67.5,
“Espagne” : 46
}

def show_small_countries(population_data: dict[str, int | float]):
for country, population in population_data.items():
if population < 50:
print(f"{country}: {population}")

show_small_countries(population)
``````
``````Thank you for your help!
I've got the following error:

Populations = {
"Allemagne" : 81,
"Italie" : 60,
"Suisse" : 8.7,
"Luxembourg": 0.5,
"Belgique": 11,
"France" : 67.5,
"Espagne" : 46
}

def show_small_countries(population_data: dict[str, int | float]):
for country, population in population_data.items():
if populations < 50:
print(f"{country}: {population}")

show_small_countries(population)

ameError                                 Traceback (most recent call last)
Input In [39], in <cell line: 6>()
3         if populations < 50:
4             print(f"{country}: {population}")
----> 6 show_small_countries(population)

NameError: name 'population' is not defined
``````

Check the exact spelling of the name of your dictionary.

``````Thank you!
I've tried with "Populations" like in the dictionary but I get the same error.
``````

``````I've discovered the right code!