发布于 2015-06-14 02:01:05 | 161 次阅读 | 评论: 0 | 来源: 网络整理

赋值表达式(Assignment Operator)

The assigment operator sets a new value for a given expression. It has the following form: 赋值表达式会对某个给定的表达式赋值。 它有如下的形式;

expression = value

就是把右边的 value 赋值给左边的 expression. 如果左边的expression 需要接收多个参数(是一个tuple ),那么右边必须也是一个具有同样数量参数的tuple. (允许嵌套的tuple)


(a, _, (b, c)) = ("test", 9.45, (12, 3))
// a is "test", b is 12, c is 3, and 9.45 is ignored

赋值运算符不返回任何值。


赋值运算符语法
赋值运算符 → =
 

最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务