python - What's the simplest way to assign list members to different variables? -
the way was:
var1 = list[0] var2 = list[1] var3 = list[2] var4 = list[3] ... is there simpler way?
var1, var2, var3, var4 = l this assumes l 4 elements long. of time, want that, if don't,
var1, var2, var3, var4 = l[:4] will ignore elements.
Comments
Post a Comment