Question: 3-Python-MajorityVote Highest grade: Problem Statement Create a program that prints the majority vote in a list. A majority vote is an element that occurs >

3-Python-MajorityVote Highest grade: Problem Statement Create a program that prints the majority vote in a list. A majority vote is an element that occurs > N/2 times in a list (where N is the length of the list). Examples ["A", "A", "B"] - "A" ["A", "A", "A", "B", "C", "A"] - "A" ("A", "8", "8", "A", "C", "C"] - None Notes The frequency of the majority element must be strictly greater than 1/2. . If there is no majority element, print nothing. . If the list is empty, print nothing. Hint: You will want to use the count() function from Zybooks 19.2 and Python Video #12 Submit 4-Python-Everywhere List Highest grade: Problem Statement Given a list and an integer, determine if that integer is "everywhere" in the list. We define a value as being "everywhere" if, for every pair of adjacent elements in the list, at least one element in the pair is that value. Return true if the given value is "everywhere" in the list. Otherwise, return false. The first input is the comma delimited string (use .split() to turn it into a list). The next input is the integer that we are trying to determine is "everywhere". Sample Input 1 1,2,1,3 1 Sample Output 1 True Submit 3-Python-MajorityVote Highest grade ["A", "A", "8"] + "A" ["A", "A", "A", "B", "C", "A"] - "A" ["A", "B", "B", "A", "C", "C"] - None Notes The frequency of the majority element must be strictly greater than 1/2. If there is no majority element, print nothing. If the list is empty, print nothing. Hint: You will want to use the .count() function from Zybooks 19.2 and Python Video #12 Sample Input 1 ABCB ABGBB Sample Output 1 B Submit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
