标签:运算符 赋值 赋值运算符 col div code nbsp 实例 python
以下实例演示了Python所有赋值运算符的操作:
#!/usr/bin/python # -*- coding: UTF-8 -*- a = 21 b = 10 c = 0 c = a + b print "1 - c 的值为:", c c += a print "2 - c 的值为:", c c *= a print "3 - c 的值为:", c c /= a print "4 - c 的值为:", c c = 2 c %= a print "5 - c 的值为:", c c **= a print "6 - c 的值为:", c c //= a print "7 - c 的值为:", c
标签:运算符 赋值 赋值运算符 col div code nbsp 实例 python
原文地址:https://www.cnblogs.com/furuihua/p/11227347.html