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

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -