Skip to content

Instantly share code, notes, and snippets.

import pytest
class IntervalMap:
def __init__(self):
self.limits = []
self.map = {}
def __setitem__(self, upper_bound, value):
self.limits.append(upper_bound)
from itertools import zip_longest
class Bits(bytes):
CHUNK = 8
def __new__(cls, n):
return super().__new__(cls, cls.number_to_bits(n))
@staticmethod
"""Geometry"""
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
def __eq__(self, other):
return self.x == other.x and self.y == other.y
@fbidu
fbidu / mimimi.py
Last active August 10, 2018 02:21
def mimimi(frase):
"""
Função que mimimiza frases
>>> mimimi('Por que você não tá estudando pra sua prova de amanhã?')
'Pir qii vici nii ti istidindi pri sii privi di iminhi?'
"""
n = ('ã', 'a', 'e', 'o', 'u', 'á', 'é', 'ê', 'í', 'ó')
for letra in n:
frase = frase.replace(letra, 'i')
return frase