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
""" | |
The Invocation of Metric Code | |
============================= | |
A Pythonic poem in (mostly) metric form. | |
Hacks until the devs publish a fix: | |
- "()", "[]", ".", ":", "_", "=" and "==" don't contribute! | |
- Comments are part of the poem! Except the first one! |
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
def _squares(n): | |
""" | |
Arguments: | |
n (int): arbitray integer | |
Returns: | |
a list of squares up to the value of ``n``. | |
""" | |
return [ |
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
from typing import List, Union | |
import random | |
def recursive_sum_of_squares( | |
x: List[Union[float,int]], | |
checked: bool = False | |
) -> float: | |
n = len(x) |
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 python | |
import argparse | |
def main(command_line=None): | |
parser = argparse.ArgumentParser('Blame Praise app') | |
parser.add_argument( | |
'--debug', | |
action='store_true', | |
help='Print debug info' |