Skip to content

Instantly share code, notes, and snippets.

View acwoss's full-sized avatar
🐍

Anderson Carlos Woss acwoss

🐍
View GitHub Profile
@acwoss
acwoss / main.py
Created September 24, 2018 16:27
HatefulRundownPaint created by acwoss - https://repl.it/@acwoss/HatefulRundownPaint
from math import factorial, radians, isclose, sin
def seno(x, n=7):
# Se o ângulo for em graus, converte para radianos
if x > 1:
x = radians(x)
def termo_geral(x, i):
return ((-1)**i / factorial(2*i+1)) * (x**(2*i+1))
{
"has_more": true,
"items": [
{
"display_name": "Maniero",
"location": "Rio Claro - SP - Brasil",
"reputation": 288138
},
{
"display_name": "Sergio",
@acwoss
acwoss / main.py
Created August 17, 2018 17:39
SkyblueFantasticChapter created by acwoss - https://repl.it/@acwoss/SkyblueFantasticChapter
__author__ = 'Anderson Carlos Woss'
def hello():
f'Autor: {__author__}'
print('Hello')
print(hello.__doc__) # None
@acwoss
acwoss / main.py
Created August 17, 2018 17:36
LowestMedicalExpertise created by acwoss - https://repl.it/@acwoss/LowestMedicalExpertise
def hello():
'Exibe uma saudação'
print('Hello')
print(hello.__doc__)
@acwoss
acwoss / main.py
Created August 16, 2018 01:36
TrustyDistortedExecutable created by acwoss - https://repl.it/@acwoss/TrustyDistortedExecutable
import numpy
dimensions = input('Dimensões da matriz NxM: ').split()
N, M = [int(value) for value in dimensions]
matrix = []
for i in range(N):
row = input(f'Linha {i+1}: ').split()
@acwoss
acwoss / main.py
Created August 16, 2018 01:35
TrustyDistortedExecutable created by acwoss - https://repl.it/@acwoss/TrustyDistortedExecutable
import numpy
dimensions = input('Dimensões da matriz NxM: ').split()
N, M = [int(value) for value in dimensions]
matrix = []
for i in range(N):
row = input(f'Linha {i+1}: ').split()
{
"colors": [
{
"color": "black",
"category": "hue",
"type": "primary",
"code": {
"rgba": [255,255,255,1],
"hex": "#000"
}
@acwoss
acwoss / main.py
Created June 15, 2018 12:45
SuspiciousAromaticArray created by acwoss - https://repl.it/@acwoss/SuspiciousAromaticArray
import sched, time, threading, sys
print('Para quando deseja configurar o alarme?')
year = int(input('Ano? '))
month = int(input('Mês? '))
day = int(input('Dia? '))
hour = int(input('Hora? '))
minute = int(input('Minutos? '))
second = int(input('Segundos? '))
data = ['Joao', '83889023', 'Maria', '81944356', 'Marcos', '32258899', 'Ana', '88235423', 'George', '1254345', 'Rafaela', '8899345671', 'Pedro', '83223345', 'Aline', '842234565', 'Carlos', '83554463', 'Julia', '13565446', 'Murilo', '23543646', 'Mayra', '233253425', 'Italo', '842142543', 'Rita', '3253464457', 'Aldo', '77443456', 'Raquel', '8384423553', 'Henrique', '88342235', 'Joyce', '987676342', 'Daniel', '3253456346', 'Livia', '325346634', 'Pablo', '87461723', 'Carla', '87351236']
def pairwise(iterable):
it = iter(iterable)
return zip(it, it)
name_map = {number: name for name, number in pairwise(data)}
print(name_map)
palavra1 = {'palavra': 'sim', 'positivo': 0}
palavra2 = {'palavra': 'não', 'positivo': 0}
palavras = [palavra1, palavra2]
resultado1 = filter(lambda termo: termo['palavra'] == 'sim', palavras)
resultado2 = [termo for termo in palavras if termo['palavra'] == 'sim']
resultado3 = (termo for termo in palavras if termo['palavra'] == 'sim')
print('Utilizando filter:', list(resultado1))
print('Utilizando list comprehension:', resultado2)