check04b.py - class CreditCard Contains a credit card that...

This preview shows page 1 out of 1 page.

class CreditCard: """ Contains a credit card that has two addressess""" def __init__(self): self.name = "" self.number = "" self.mailing_address = Address() self.billing_address = Address() def display(self): print(self.name) print(self.number) print("Mailing Address:") self.mailing_address.display() print("Billing Address:") self.billing_address.display() class Address: """ Contains a street address """ def __init__(self): self.street = "" self.city = "" self.state = "" self.zip = "" def display(self): print(self.street) print("{}, {} {}".format(self.city, self.state, self.zip))

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture