Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View samuelgrigolato's full-sized avatar

Samuel Grigolato samuelgrigolato

View GitHub Profile
@samuelgrigolato
samuelgrigolato / simulacao.py
Created September 13, 2020 15:17
Simulação de mudança de temperatura para partidas Cosmos
from random import sample
from collections import defaultdict
RODADAS = 7
EVENTOS = [-2, -1, -1, -1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2]
def simular_partida():
eventos_da_partida = sample(EVENTOS, RODADAS)
@samuelgrigolato
samuelgrigolato / nomes.py
Last active December 17, 2018 13:09
Resolução do Problema Nomes de Autores de Obras Bibliográficas (dojo Randori Opensanca/GDG-Aqa 15/12/2018)
ARTIGOS = ["da", "de", "do", "das", "dos"]
PARENTESCOS = ["FILHO", "FILHA", "NETO", "NETA", "SOBRINHO", "SOBRINHA", "JUNIOR"]
def formatar_nome(nome):
if nome is None:
raise ValueError("Nome é obrigatório!")
if type(nome) != str: