import yaml data = { 'numbers': [1, 2, 3] } print(yaml.dump(data['numbers'], default_flow_style=True))
[1, 2, 3]