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
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