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 random | |
def crea_quadrantes(): | |
quadrantes = dict() | |
for i in range(1,10): | |
quadrantes['q'+str(i)] = str(i) | |
return quadrantes |
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 random | |
def crea_quadrantes(): | |
quadrantes = dict() | |
for i in range(1,10): | |
quadrantes['q'+str(i)] = str(i) | |
return quadrantes |
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 csv | |
from .models import Player | |
class FootballExplorer(object): | |
def __init__(self, csv_file_name): | |
self.csv_file_name = csv_file_name | |
def __iter__(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 Person(object): | |
def __init__(self, first_name, last_name, email): | |
self.first_name = first_name | |
self.last_name = last_name | |
self.email = email | |
class Customer(Person): | |
pass |
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 Weight(object): | |
def __init__(self, value): | |
self.value = value | |
@property | |
def kilograms(self): | |
return self.value * 2.2 | |
@property | |
def pounds(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 Operation(object): | |
def __init__(self, *args): | |
self.args = args | |
# Do something here | |
pass | |
def operate(self): | |
raise NotImplementedError() | |