flovearth / 69_Vote_Counter

The purpose of this coding challenge is to write a program that finds the majority vote.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Coding Challenge - 012: Vote Count

The purpose of this coding challenge is to write a program that finds the majority vote.

Learning Outcomes

At the end of this coding challenge, students will be able to;

  • Analyze a problem, identify, and apply programming knowledge for an appropriate solution.

  • Implement loops to solve a problem.

  • Implement conditional statements to solva a problem.

  • Make use of built in functions in Python.

  • Demonstrate their knowledge of algorithmic design principles by solving the problem effectively.

Problem Statement

Write a function that takes in a list and finds the majority vote inside it. Each letter in the least means an individual vote in favour of that letter. You can use the following list to test your function:

majority_vote(["A", "A", "A", "B", "C", "A"])

  • Expected Outputs:
Input: majority_vote(["A", "A", "A", "B", "C", "A"]) 
Output: "A"

About

The purpose of this coding challenge is to write a program that finds the majority vote.


Languages

Language:Python 100.0%