Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

Write a function that returns a list of unique candidates who got more than a specified percentage (as a decimal) of **total votes** cast. If the percentage is not between 0 and 1.0 (inclusive), retur

Write a function that returns a list of unique candidates who got more than a specified percentage (as a decimal) of **total votes** cast. If the percentage is not between 0 and 1.0 (inclusive), return an empty list. Hint: Find the total number of votes, then the number of votes for each candidate. Example: >>> print(get_top_candidates(read_txt("us-2016-primary-results.txt"), 0.15)) ['Hillary Clinton', 'Donald Trump', 'Marco Rubio', 'Ted Cruz']''

'def get_top_candidates(data, percentage): 

log_function_call("testlog.csv", "get_top_candidates") # DON'T CHANGE pass 

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question