Skip to content

Instantly share code, notes, and snippets.

@jordanhudgens
Created March 10, 2018 04:43
Show Gist options
  • Save jordanhudgens/6c2f4e2c4469d393286f08ced3f913a2 to your computer and use it in GitHub Desktop.
Save jordanhudgens/6c2f4e2c4469d393286f08ced3f913a2 to your computer and use it in GitHub Desktop.
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