Skip to content

Instantly share code, notes, and snippets.

@tormath1
Created January 4, 2019 19:48
Show Gist options
  • Save tormath1/5b9ec19e88d7134349cd69ef9961f6e7 to your computer and use it in GitHub Desktop.
Save tormath1/5b9ec19e88d7134349cd69ef9961f6e7 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import requests
def get_quote():
return requests.get("https://breaking-bad-quotes.herokuapp.com/v1/quotes").json()[0]
def format_quote(q):
author = q.get("author")
quote = q.get("quote")
return f"'{quote}' - {author}"
if __name__ == "__main__":
quote = get_quote()
print(format_quote(quote))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment