[Tutor] Java style assignments in Python

tpc at csua.berkeley.edu tpc at csua.berkeley.edu
Wed Sep 10 11:30:12 EDT 2003


hello all, I was curious if there is a way to implement Java style
assignments in Python.  Let's say I have a block of code:

list_A = []
list_B = []
list_C = []

and I want to condense it to:

list_A, list_B, list_C = []

Is there any way to do this without generating an error:

ValueError: unpack list of wrong size

?  Thanks in advance




More information about the Tutor mailing list