Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
split + dict solution in Clear category for YAML. Simple Dict by kdim
def yaml(a):
a = [i for i in a.split('\n') if i]
a = [i.split(': ') for i in a]
return dict([[i, int(j)] if j.isdigit() else [i, j] for i, j in a])
Jan. 27, 2021
Comments: