Browse Source

make files pep8 compliant

master
T. Meissner 9 years ago
parent
commit
b32f55befa
2 changed files with 9 additions and 9 deletions
  1. +3
    -3
      python_3_oop/chapter03/duck_typing_wikipedia.py
  2. +6
    -6
      python_3_oop/chapter03/real_estate.py

+ 3
- 3
python_3_oop/chapter03/duck_typing_wikipedia.py View File

@ -3,7 +3,7 @@
class Bird:
"Birds have a name that they return in string represention"
"""Birds have a name that they return in string represention"""
def __init__(self, name):
self.name = name
@ -13,14 +13,14 @@ class Bird:
class Duck(Bird):
"Ducks are birds which can quak"
"""Ducks are birds which can quak"""
def quak(self):
print(str(self)+': quak')
class Frog:
"Frogs also can quak"
"""Frogs also can quak"""
def quak(self):
print(str(self)+': quak')


+ 6
- 6
python_3_oop/chapter03/real_estate.py View File

@ -47,9 +47,9 @@ class Apartment(Property):
def prompt_init():
parent_init = Property.prompt_init()
laundry = get_valid_input("What laundry facilities does the property "
"have?", Apartment.valid_laundries)
"have?", Apartment.valid_laundries)
balcony = get_valid_input("Does the property have a balcony?",
Apartment.valid_balconies)
Apartment.valid_balconies)
parent_init.update({
"laundry": laundry,
"balcony": balcony
@ -132,10 +132,10 @@ class Rental:
@staticmethod
def prompt_init():
return dict(
rent = input("What is the monthly rent? "),
rent=input("What is the monthly rent? "),
utilities=input("What are the estimated utilities? "),
furnished=get_valid_input("Is the property furnished?",
("yes", "no"))
("yes", "no"))
)
@ -193,9 +193,9 @@ class Agent:
def add_property(self):
property_type = get_valid_input("What type of property?",
("house", "apartment")).lower()
("house", "apartment")).lower()
payment_type = get_valid_input("What payment type?",
("purchase", "rental")).lower()
("purchase", "rental")).lower()
property_class = self.type_map[(property_type, payment_type)]
init_args = property_class.prompt_init()
self.property_list.append(property_class(**init_args))


Loading…
Cancel
Save