More elegant way of declaring multiple variables at the same time

后端 未结 10 2104
面向向阳花
面向向阳花 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条回答
  •  庸人自扰
    2020-11-30 17:50

    Sounds like you're approaching your problem the wrong way to me.

    Rewrite your code to use a tuple or write a class to store all of the data.

提交回复
热议问题