The pairs of ethanol, C2H5OH, are counted. What does this print? c = {}; for el, n in [("C", "2"), ("H", "5"), ("O", ""), ("H", "")]:; c[el] = c.get(el, 0) + int(n or 1); print(c)
c = {}; for el, n in [("C", "2"), ("H", "5"), ("O", ""), ("H", "")]:; c[el] = c.get(el, 0) + int(n or 1); print(c)
Log in to join the discussion.
Loading…