
YAML. Complex Structure
The 4th task in the series of missions about the YAML format will be devoted to a complex structure.
YAML | Python/TypeScript |
---|---|
A list element can be another list. |
|
- Alex - - odessa - dnipro - Li |
[ "Alex", [ "odessa", "dnipro" ], "Li" ] |
A dictionary can also be an element of an list. |
|
- 67 - name: Irv game: Mario - - 56 |
[ 67, { "game": "Mario", "name": "Irv" }, ... |
name: Alex study: type: school number: 78 age: 14 |
{ "age": 14, "study": { "type": "school", "number": 78 }, "name": "Alex" } |
A list can also be an element of dictionary. |
|
name: Alex study: - 89 - 89 - "Hell" age: 14 |
{ "age": 14, "study": [ 89, 89, "Hell" ], "name": "Alex" } |
And, of course, data can have more than one nesting level. |
|
name: Alex study: - type: school num: 89 - type: school num: 12 age: 14 |
{ "age": 14, "study": [ { "num": 89, "type": "school" }, { "num": 12, "type": "school" } ], "name": "Alex" } |
You should be an authorized user in order to see the full description and start solving this mission.