More elegant way of declaring multiple variables at the same time

后端 未结 10 2122
面向向阳花
面向向阳花 2020-11-30 17:12

To declare multiple variables at the \"same time\" I would do:

a, b = True, False

But if I had to declare much more variables, it turns les

10条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-30 17:30

    In your case, I would use YAML .

    That is an elegant and professional standard for dealing with multiple parameters. The values are loaded from a separate file. You can see some info in this link:

    https://keleshev.com/yaml-quick-introduction

    But it is easier to Google it, as it is a standard, there are hundreds of info about it, you can find what best fits to your understanding. ;)

    Best regards.

提交回复
热议问题