party
is
the
{party.title()}.”)
The program loops through every key-value pair in our election_list. As it
goes through, every pair of the key is assigned to the name variable while
the value is assigned the party variable. With only the last two lines, we can
generate a full list of all candidates in the election.
John Campbell’s party is the Freedom Party.
Eric Longman’s party is the Sovereign Nation Party.
Amanda Drill’s party is the Women Liberation Movement.
Condolence Rice’s party is the Democratic Party.
Donald Trump’s party is the Republican Party.
With this, you can display from a single name to millions of names in a list
to the screen.
Do'stlaringiz bilan baham: |