Where would I look to understand why ... works

  • Thread starter Jacob, Raymond A Jr
  • Start date
J

Jacob, Raymond A Jr

=20
I create a small method

def counting(p1,p2)
p1 =3D p1 + 1
p2 =3D p2 + 2
return p1,p2
end

sum-by-1s=3D0
sum-by-2s=3D0
while line =3D gets
# need driver test the method
line=3Dline.chop
sum-by-1s, sum-by-2s =3D counting(sum-by-1s,sum-by-2s)
end=09

The method works. I am using PickAxe as my reference.
I don't recall see any thing stating you could assign values in an array
to variables by separating the variables by commas on the leftside of
the=20
assignment statement. I just want to know which book or reference
should I use to
understand why assignments can be made in this way?
Or am I just seeing a side effect of my poor coding skills?

Thank you,
Raymond
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,222
Messages
2,571,138
Members
47,755
Latest member
Grazynkaa

Latest Threads

Top