I am trying to get the following output
water:300ml
milk:200ml
coffee:100g
money:$0
The problem is that ml, g and $ are not part of the dictionary that I need to use and I can't convert the integers in the dictionary to strings because they need do be used in later calculations.
And of course the dollar sign is tricky because it has to be at the front.
I tried this code, but it doesn't work, and I just can't come up with an idea. TIA
resources = {
"water": 300,
"milk": 200,
"coffee": 100,
"money": 0,
}
for k,v in resources.items():
levels= ['ml', 'ml', 'g', '$']
print(k, ':', v)
for level in levels:
totals = (f'{v}{level}')
print(totals)