Let say, your task is to eat so you wouldn't die. You are literally asking: "In what situation I should eat banana or an apple?".
Whatever you like or the only option you have...
I never liked YAML because one tricky space can broke things and, well, I used JS much more then Python. JSON is more popular, and many APIs use JSON only.
If you want more, Almighty Google/Bing/DuckDuckGo/Whatever will help you