Bootstrap has a style called badge, which is defined like this:
.badge {
display: inline-block;
padding: .25em .4em;
font-size: 75%;
import random | |
import string | |
from functools import partial | |
from typing import Iterable, Tuple | |
from timeit import timeit | |
REPEAT = 1000 | |
CHARACTERS = string.digits + string.ascii_letters | |
CHARACTERS_FULL = string.printable |
Bootstrap has a style called badge, which is defined like this:
.badge {
display: inline-block;
padding: .25em .4em;
font-size: 75%;
""" | |
Install PyOpenGL: | |
$ pip install PyOpenGL | |
Run this file: | |
$ python main.py | |
Controls: | |
- ESC - closes the demo | |
- '+' key - increases rotation speed |
import logging | |
def myfunc(a, b, c, d, logger=None): | |
"""My func is super awesome. | |
Example: | |
>>> import logging, sys | |
>>> logging.basicConfig(stream=sys.stdout, level=logging.DEBUG, format="%(levelname)s: %(message)s") | |
>>> myfunc(1, 2, 3, 4) |
import random | |
from microbit import * | |
class board: | |
grid = None | |
def __init__(self): | |
self.grid = [ | |
[False, False, False, False, False], | |
[False, False, False, False, False], |
.idea | |
.venv | |
__pycache__ | |
*.pyi |
#!/bin/bash | |
__pyenv_install_version(){ | |
local ver=$1 | |
local venv=$2 | |
pyenv install -s $ver | |
pyenv virtualenv $ver $venv | |
} | |
echo Installing... |
from itertools import combinations | |
SUM = 25 | |
NUMS = [20, 17, 15, 13, 10, 8, 7, 5, 5] | |
def calc(variant, nums): | |
return sum([x for i, x in enumerate(nums) if i in variant]) | |
def check(variant, sum, nums): |
def space(s, n): | |
"""inserts a space every n characters in string s | |
>>> space('0123456789', 3) | |
'012 345 678 9' | |
>>> space('0123456789', 4) | |
'0123 4567 89' | |
""" | |
return ' '.join(s[i:i+n] for i in range(0, len(s), n)) |