Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Not first solution in Clear category for YAML. Simple Dict by swagg010164
def to_int(value):
try:
return int(value)
except ValueError:
return value
def yaml(a):
s = [k.split(':') for k in a.split('\n') if k != '']
return {a.strip(): to_int(b.strip()) for a, b in s}
Nov. 7, 2019
Comments: