Add default introductory code example (#516)
Instead of having logic for a fallback in the backend, we're going to actually add a snippet.
This commit is contained in:
committed by
Tammo Behrends
parent
22fd5bce11
commit
f7a5c3bb2d
10
docs/SNIPPET.txt
Normal file
10
docs/SNIPPET.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
prices = {'apple': 0.75, 'egg': 0.50}
|
||||
cart = {
|
||||
'apple': 1,
|
||||
'egg': 6
|
||||
}
|
||||
|
||||
bill = sum(prices[item] * cart[item]
|
||||
for item in cart)
|
||||
|
||||
print(f'I have to pay {bill:.2f}')
|
||||
Reference in New Issue
Block a user