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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import random | |
import sys | |
import pdb | |
class Cartela: | |
def __init__(self): | |
self.numeros = [[],[],[],[]] | |
self.numerosmarcados = 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
# coding=utf-8 | |
# Modulo sorteio.py | |
# Data de criação 18/12/2014 | |
# Gabriela Cavalcante da Silva | |
''' | |
- Coloque nomes sem acentos. | |
- O arquivo com nome e email deve estrar na seguinte estrutura: | |
nome1 email1 |
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(object): | |
FEMALE = 0 | |
MALE = 1 | |
def __init__(self, nome, sexo): | |
super(Pessoa, self).__init__() | |
self._nome = nome | |
self._sexo = sexo | |
def __str__(self): |
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 A(object): | |
def f(): | |
pass | |
class B(object): | |
pass | |
def f(): pass | |
class C(A, B): |
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 A(Exception): | |
pass | |
def f(): | |
raise A | |
def g(): | |
try: | |
f() | |
except A: |
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 Empregado: | |
pass | |
joao = Empregado() # Criar um registro de empregado vazio | |
# Preencher campos do registrp | |
joao.nome = u'João da Silva' | |
joao.depto = u'laboratório de informática' | |
joao.salario = 1000 |
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
for elemento in [1, 2, 3]: | |
print elemento | |
for elemento in (1, 2, 3): | |
print elemento | |
for chave in {'one':1, 'two':2}: | |
print chave | |
for car in "123": | |
print car | |
for linha in open("myfile.txt"): | |
print linha |
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=0): | |
self.nome = nome | |
self.idade = idade | |
def getIdade(self): | |
return self.idade | |
class PessoaFisica(Pessoa): | |
def __init__(self, CPF, nome='', idade=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
/** | |
* Return the value of the expression | |
*/ | |
public double eval() throws NumberFormatException { | |
if (this.isLeaf()) return Double.parseDouble(this.data()); | |
Double left = ((ExpressionTree) this.left()).eval(); | |
Double right = ((ExpressionTree) this.right()).eval(); | |
return eval(this.data(), left, right); |
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
package houseofcards; | |
import java.util.ArrayList; | |
/** | |
* Class model to Partie. | |
* @author gabriela cavalcante | |
* @version 09.10 | |
*/ | |
public class Partie { |
OlderNewer