I have the following list
bar = ['a','b','c','x','y','z']
What I want to do is assign 1, 4 and 5 to the bar values ββin v1,v2,v3 , there is a more compact way to do this:
v1, v2, v3 = [bar[0], bar[3], bar[4]]
Because in Perl, you can do something like this:
my($v1, $v2, $v3) = @bar[0,3,4];
python list slice
pdubois Mar 31 '14 at 8:15 2014-03-31 08:15
source share