This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = int(input('Número: ')) | |
numero = x | |
fatorial = 1 | |
while x != 1: | |
fatorial *= x | |
x -= 1 | |
print ("Fatorial de {} é {}".format(numero,fatorial)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Pessoa(): | |
def __init__(self,nome,idade): | |
self.nome = nome | |
self.idade = int(input('Quantos anos você tem: ') | |
def verifica(self): | |
maior = '' | |
if self.idade > 18: | |
maior = 'é' | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Conta(object): | |
def __init__(self, num_conta,nome,saldo=0): | |
self.num_conta = num_conta | |
self.nome = nome | |
self.saldo = saldo | |
def alterar_nome(self,nome): | |
self.nome = nome | |
def deposito(self,valor): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def soma(n1,n2): | |
return n1+n2 | |
def subtr(n1,n2): | |
return n1-n2 | |
def mult(n1,n2): | |
result = 0 | |
for i in range(1,n2+1): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Media_Aluno</title> | |
</head> | |
<body> | |
<?php | |
$resultado = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>IMC</title> | |
</head> | |
<body> | |
<form> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
existentes = [5,4,2,2] | |
disponiveis = [3,3,2,1] | |
requisitados = [ | |
[2,0,3,1], | |
[3,1,4,2], | |
[0,0,0,0], | |
[1,2,1,1] | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Data(object): | |
def __init__(self,dia=None,mes=None,ano=None): | |
if all([dia != None, mes != None , ano != None]): | |
self.dia = dia | |
self.mes = mes | |
self.ano = ano | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
class TestData(unittest.TestCase): | |
def test_data_definida_deve_retornar_valores_validos(self): | |
data = Data(11,10,2016) | |
self.assertEqual(data.dia,11) | |
self.assertEqual(data.mes,10) | |
self.assertEqual(data.ano,2016) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface LeitorDeArquivos{ | |
public List<String> ler(File arquivo); | |
} | |
class LeitorTXT implements LeitorDeArquivos{ | |
public ArrayList<String> ler(File arquivo){ | |
//Processamento java para retornar as linhas do arquivo de texto. |
OlderNewer