num + = num 不等于num = num + num
例如:
a = [100] def sum(num): # num += num num = num + num # 不等于num += num print(num) sum(a) print(a)
输出结果:[100,100]
[100]
a = [100] def sum(num): num += num print(num) sum(a) print(a)
输出结果:[100,100]
[100,100]
Posted sineik
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 小知识相关的知识,希望对你有一定的参考价值。
num + = num 不等于num = num + num
例如:
a = [100] def sum(num): # num += num num = num + num # 不等于num += num print(num) sum(a) print(a)
输出结果:[100,100]
[100]
a = [100] def sum(num): num += num print(num) sum(a) print(a)
输出结果:[100,100]
[100,100]
以上是关于python 小知识的主要内容,如果未能解决你的问题,请参考以下文章
Flutterflutter doctor 报错Android license status unknown. Run `flutter doctor --android-licenses‘(代码片段