Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Second solution in Clear category for YAML. Simple Dict by saad452
import io
def yaml(a: str):
result = {}
with io.StringIO(a) as s:
for line in s:
line = line.strip()
if not line:
continue
key, value = line.split(": ", 1)
result[key] = int(value) if value.isdigit() else value
return result
Nov. 17, 2025
Comments: