More elegant way of declaring multiple variables at the same time

后端 未结 10 2118
面向向阳花
面向向阳花 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:28

    Like JavaScript you can also use multiple statements on one line in python a = 1; b = "Hello World"; c += 3

提交回复
热议问题