Created
February 7, 2018 12:59
-
-
Save goyalrohit/1472bd45efa9de9506caea6db2ced19f to your computer and use it in GitHub Desktop.
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 Order: | |
# class attribute | |
orders = [] | |
# instance attributes | |
orderid = 0 | |
shipping_address = '' | |
expedited = False | |
shipped = False | |
customer = None | |
def get_expedited_orders_customer_names(self): | |
output = [] | |
for order in Order.orders: | |
if order.expedited: | |
output.append(order.customer.name) | |
return output | |
def get_expedited_orders_customer_addresses(self): | |
output = [] | |
for order in Order.orders: | |
if order.expedited: | |
output.append(order.customer.address) | |
return output | |
def get_expedited_orders_shipping_addresses(self): | |
output = [] | |
for order in Order.orders: | |
if order.expedited: | |
output.append(order.shipping_address) | |
return output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment