Answer:
Correct code for the above question which is written after the defined list to display the output.
for x,y in country_pop.items(): #for loop to prints the list items.
print(str(x)+" has "+str(y)+" people") #print function to print the value.
Output:
- The above code is in python language which display the output as the above question demands.
Step-by-step explanation:
- The above question code is written in python language to display the result, but this code is not correct.
- The above code needs a 'for' loop, which will render the list item one by one.
- The above-list defined in the form of key-value pair, So there is a need for the ''item" function which is the part of the python dictionary to display the list items.
- There also needs to define the two variables in the for loop, one is for key and the other is for value.