Assign Many Variables at Once, Python
Is there a better way to do this? a, b, c, = "yyy", "yyy", "yyy" Obvious attempts fails a, b, c, = "yyy" a, b, c = "yyy"*3 Technically, the following works, but I don't think it's intuitive as this logic says a, b, and c are the same, whereas all I'm trying to do is say they initialize as the same value a=b=c="yyy" No need to use tuple assignment here; the right-hand value is immutable, so you can just as well share the reference: a = b = c = 'yyy' This is not unintuitive at all, in my view, and the python compiler will only need to store one constant with the bytecode, while using tuple