← Back to challenges

Unlucky Years

PythonHarddateslanguage_fundamentals

Instructions

Create a function which returns how many Friday 13ths there are in a given year.

Examples

how_unlucky(2020) ➞ 2

how_unlucky(2026) ➞ 3

how_unlucky(2016) ➞ 1

Notes

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.