YAML. Complex Structure
4-я задача в серии миссий о формате YAML будет посвящена сложной структуре.
| YAML | Python/TypeScript |
|---|---|
|
Элементом списка может быть другой список. |
|
- Alex
-
- odessa
- dnipro
- Li
|
[
"Alex",
[
"odessa",
"dnipro"
],
"Li"
]
|
|
Элементом списка может быть словарь. |
|
- 67
-
name: Irv
game: Mario
-
- 56
|
[
67,
{
"game": "Mario",
"name": "Irv"
},
None/null,
... |
name: Alex
study:
type: school
number: 78
age: 14
|
{
"age": 14,
"study": {
"type": "school",
"number": 78
},
"name": "Alex"
}
|
|
Элементом словаря может быть список. |
|
name: Alex
study:
- 89
- 89
- "Hell"
age: 14
|
{
"age": 14,
"study": [
89,
89,
"Hell"
],
"name": "Alex"
}
|
|
Ну и конечно же данные могут иметь более одного уровня вложенности. |
|
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.