字符串

  • "", 双引号

    • 进行转义

      • eg: words: "Lucy \n Lily" 会换行
  • '', 单引号

    • 转移字符无效,只是普通字符

      • eg: words: "Lucy \n Lily" 不会换行

Map, Dict

  • 多行模式

    • ":"

      • 冒号分割 + 键值对

        1
        2
        3
        
        pet:
          type: cat
          age: 13
  • 单行模式

    • 冒号 + "{}"
1
pet: {type: cat, age: 13}

数组(List, Set)

  • 多行模式

    • 冒号 + "-"

      1
      2
      3
      4
      
      pets:
        - cat
        - dog
        - bird
  • 单行模式

    • 冒号 + "[]"

      1
      
      pets: [cat, dog, bird]