This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tuples = [(1, 2), (3, 4, 5), (6, 7, 8, 9)] | |
for *_, last in tuples: | |
print(last) | |
# Prints: 2, 5, 9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 |
NewerOlder