Skip to content

Instantly share code, notes, and snippets.

View pavdmyt's full-sized avatar
🛠️
Focusing

Pavel Dmytrenko pavdmyt

🛠️
Focusing
View GitHub Profile
@pavdmyt
pavdmyt / scrape_team_data.py
Last active January 12, 2021 19:12
A script to scrape data about Formula 1 teams from Wikipedia pages.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
A script to scrape data and stats about Formula 1 teams from Wikipedia pages.
Results are exported into a CSV file.
"""
import logging
from datetime import datetime
@pavdmyt
pavdmyt / last_item.py
Created October 29, 2015 08:51
Iterate over a list of tuples, ignore all but the last item in each tuple.
tuples = [(1, 2), (3, 4, 5), (6, 7, 8, 9)]
for *_, last in tuples:
print(last)
# Prints: 2, 5, 9
@pavdmyt
pavdmyt / some_factorials.py
Created October 1, 2015 16:31
Few ways to calculate factorial of the number.
"""
Few ways to calculate factorial of the number.
For my article: http://pavdmyt.com/digging-around-factorial-function/
"""
import math as m
def fact(x):
"""
Weird factorial function implementation