https://github.com/hackademymx/highest-occurrence-python-template
https://github.com/hackademymx/highest-occurrence-python-template
Last synced: 27 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/hackademymx/highest-occurrence-python-template
- Owner: hackademymx
- Created: 2020-04-13T22:27:29.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-01T18:02:30.000Z (about 6 years ago)
- Last Synced: 2025-03-04T05:31:39.677Z (over 1 year ago)
- Language: Python
- Size: 2.93 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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 🇲🇽.