This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
| from string import ascii_lowercase as lower_letters | |
| input_text = str(input()).lower() | |
| def to_string_ordered(string): | |
| new_string = string.replace(" ","") | |
| new_string = list(set(new_string)) | |
| new_string.sort() | |
| new_string = "".join(new_string) |
OlderNewer