Created
March 10, 2018 04:43
-
-
Save jordanhudgens/6c2f4e2c4469d393286f08ced3f913a2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Invoice: | |
def __init__(self, client, total): | |
self.client = client | |
self.total = total | |
def __str__(self): | |
return f"Invoice from {self.client} for {self.total}" | |
def __repr__(self): | |
return f"Invoice({self.client}, {self.total})" | |
inv = Invoice('Google', 500) | |
print(str(inv)) | |
print(repr(inv)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment