Skip to content

Instantly share code, notes, and snippets.

@agusrichard
Created November 26, 2021 15:34
Show Gist options
  • Save agusrichard/1af49e7bd08a785979156b3113e987a3 to your computer and use it in GitHub Desktop.
Save agusrichard/1af49e7bd08a785979156b3113e987a3 to your computer and use it in GitHub Desktop.
product = {
'name': 'Burger',
'description': 'The tastiest burger ever'
}
try:
print(f"{product['name']} costs {product['price']}")
except KeyError:
print('There is no product\'s name and price')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment