Skip to content

Instantly share code, notes, and snippets.

View lucas404x's full-sized avatar
🎯
Focusing

José Lucas lucas404x

🎯
Focusing
View GitHub Profile
import pygame
class Flappy:
def __init__(self):
self.flappy = pygame.image.load('imagens/flappybird1.png')
class Janela:
def mmc(m, n):
divisor = 2
multiplicador = 1
while m != 1 or n != 1:
if m % divisor == 0 or n % divisor == 0:
multiplicador *= divisor
/**
* Autor: José Lucas
* Arquivo: ExecucaoTeste.java
* Descricao: Programa para praticar o uso de classes e objetos
* Aula: PROO – Lab3
*
**/
import classes.Musica;
"""
You are required to write a program to sort the (name, age, height) tuples by ascending order where name is string, age and height are numbers. The tuples are input by console. The sort criteria is:
1: Sort based on name;
2: Then sort based on age;
3: Then sort by score.
The priority is that name > age > score.
If the following tuples are given as input to the program:
Tom,19,80
John,20,90
Jony,17,91
def fatorial(n):
fat = 1
for i in range(n):
fat *= (n - i)
return fat
def decremento(n):
newNumber = ""
n = int(input())
n1 = int(input())
n2 = int(input())
n3 = n - (n1 + n2)
if n1 > n2 and n1 > n3:
print(n1)
elif n2 > n1 and n2 > n3:
print(n2)
import sqlite3
def create_table():
c.execute('create table IF NOT EXISTS dados(id INTEGER PRIMARY KEY AUTOINCREMENT,\
nome text,\
data_nascimento text,\
email text,\
senha text)')
def read_data():
<!DOCTYPE html>
<html lang="pt-br" >
<head>
<meta charset="UTF-8">
<title>Formulário de Login</title>
<link rel="stylesheet" href="{{ url_for('static',
filename="css/style.css") }}">
</head>
Building wheel for pillow (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/lucas/Documents/programacao/gerador-provas/venv/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-1dogez7b/pillow/setup.py'"'"'; __file__='"'"'/tmp/pip-install-1dogez7b/pillow/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-s9_73yr7 --python-tag cp38
cwd: /tmp/pip-install-1dogez7b/pillow/
Complete output (172 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
@lucas404x
lucas404x / perceptron.py
Last active December 29, 2019 15:31
Perceptron de uma camada implementado em Python 3
import random
class Perceptron:
def __init__(self, limiar, parada, taxa_aprendizado = 0.1):
self.pesos = []
self.limiar = limiar
self.parada = parada
self.taxa_aprendizado = taxa_aprendizado