Sign in
fuchsia
/
third_party
/
github.com
/
python
/
mypy
/
refs/heads/upstream/pypytest
/
.
/
test-data
/
samples
/
dict.py
blob: d74a5b5ea01aa65a0030fa31a7b00d3972187860 [
file
] [
log
] [
blame
] [
edit
]
import
typing
prices
=
{
'apple'
:
0.40
,
'banana'
:
0.50
}
my_purchase
=
{
'apple'
:
1
,
'banana'
:
6
}
grocery_bill
=
sum
(
prices
[
fruit
]
*
my_purchase
[
fruit
]
for
fruit
in
my_purchase
)
print
(
'I owe the grocer $%.2f'
%
grocery_bill
)