ruby入门_并行赋值

方便的赋值

交换变量倒是快捷

a,b=1,3
puts a,b
# ------
a,b=b,a
puts a,b

输出

1
3
3
1

你可能感兴趣的:(Ruby)