An open API service indexing awesome lists of open source software.

https://github.com/hackademymx/highest-occurrence-python-template


https://github.com/hackademymx/highest-occurrence-python-template

Last synced: 27 days ago
JSON representation

Awesome Lists containing this project

README

          

# Highest Ocurrence

Write a function that receives a list with elements of **any kind** and return an list of the most repeated element.
If more than one element has the same number of appearances, return all the elements (order not important).
In this exercise you have to write code in the file `highestOcurrence.py`.

You should write the code inside the block from the method, and delete **pass** keyword, where it says `Your amazing code here`.

## Examples

```python
highestOccurrence([2, 3, 2, 5, 6, 7, 2]) ➞ [2]

highestOccurrence([1, 2, 3, 3, "a", "b", "b", "c"]) ➞ [3, "b"]

highestOccurrence(["it", "keeps", "coding", "on", "or", "it", "gets", "the", "hose"]) ➞ ["it"]

```

## Local Test

For testing your code you must run:

```sh
pytest

```

## Notes:

- You can read the test files, so you can have an idea of what is the expected result, but **do not edit them** please.

If you have any doubts, feel free to ask 😊

Good luck! 🚀

Made with 💚 for Hackademy 🇲🇽.