Skip to content

Instantly share code, notes, and snippets.

View p1-dta's full-sized avatar
🐍
Coding Python

Dorian Turba p1-dta

🐍
Coding Python
View GitHub Profile
@p1-dta
p1-dta / count_living_per_year_perf.py
Last active April 20, 2023 17:47
Count how many people are alive per year, based on their birthyear and deathyear, aims for performances.
import collections
import random
import timeit
pop = [
(b := random.randint(1900, 2000), random.randint(b + 1, b + 100))
for _ in range(10000)
]