How to Join the list based on YAML
file, i have below file which need to join by space delimitation.
$ cat File.yml
---
fruits:
- orange
- banana
- apple
- strawberry
- berry
- cherry
...
What i tried:
>>> import yaml
>>> with open('File.yml') as f:
... result = yaml.safe_load(f)
... print(result)
...
{'fruits': ['orange', 'banana', 'apple', 'strawberry', 'berry', 'cherry']}
Can we do something {{ fruits[ item ] | join(' ') }}"
?
Desired:
"orange banana apple strawberry berry cherry"
I don't require ","
in the result.