Skip to content

Instantly share code, notes, and snippets.

@agusrichard
Created November 26, 2021 15:04
Show Gist options
  • Save agusrichard/7ff205208728ef352b8107382e92b10f to your computer and use it in GitHub Desktop.
Save agusrichard/7ff205208728ef352b8107382e92b10f to your computer and use it in GitHub Desktop.
product = {
'price': 2000,
'name': 'Burger',
'description': 'The tastiest burger ever'
}
if 'name' in product and 'price' in product:
print(f"{product['name']} costs {product['price']}")
else:
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