Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

FOR PYTHON: Write a function vote () that takes as a parameter a list of names o

ID: 643950 • Letter: F

Question

FOR PYTHON: Write a function vote() that takes as a parameter a list of names of candidates up for election and repeatedly asks the user to enter a name of one of the candidates. When the user enters the empty string, the function prints for every name on the ballot the number of votes that the candidate received. The candidates and vote totals can be printed in any order as long as all of the information is presented. If the user types a name that cannot be found in the list of candidates, the vote is recorded for the 'Unknown' candidate. Capitalization shouldn't matter so that a candidate's name appearing in all uppercase, all lowercase, or in mixed case should record a vote for the associated person. When the user types a blank name, then the function should stop and report the vote totals. The vote totals should be reported using correct grammar, meaning using was/were and the singular or plural of vote appropriately. The following shows a sample run of the vote() function. Please note that your function must work on all valid examples, not just the ones provided below:

FOR PYTHON: Write a function vote() that takes as a parameter a list of names of candidates up for election and repeatedly asks the user to enter a name of one of the candidates. When the user enters the empty string, the function prints for every name on the ballot the number of votes that the candidate received. The candidates and vote totals can be printed in any order as long as all of the information is presented. If the user types a name that cannot be found in the list of candidates, the vote is recorded for the 'Unknown' candidate. Capitalization shouldn't matter so that a candidate's name appearing in all uppercase, all lowercase, or in mixed case should record a vote for the associated person. When the user types a blank name, then the function should stop and report the vote totals. The vote totals should be reported using correct grammar, meaning using was/were and the singular or plural of vote appropriately. The following shows a sample run of the vote() function. Please note that your function must work on all valid examples, not just the ones provided below:

Explanation / Answer

Hope this logic may helps you...