官术网_书友最值得收藏!

Assigning variables

Since a variable is just a description of the underlying data, the data can change. For example, if you have a variable named time, you would expect its value to change every second. At any point, you can use the assignment operator = to assign a new value to a variable.

This code snippet explores this by creating a single variable, color, and assigning it three different values. The value of color is printed after each assignment:

color = "red"
print (color)
color = "green"
print (color)
color = "blue"
print (color)

The output from this program should look like this:

主站蜘蛛池模板: 盐山县| 交城县| 贵阳市| 阿瓦提县| 正宁县| 卢龙县| 措美县| 尼玛县| 水城县| 呼伦贝尔市| 汤原县| 柯坪县| 柳河县| 邵阳市| 高台县| 太保市| 屏东县| 金门县| 进贤县| 涟源市| 桂东县| 蒲江县| 钦州市| 永平县| 剑河县| 富顺县| 太谷县| 瑞金市| 吉林市| 丁青县| 抚松县| 余江县| 三穗县| 翁牛特旗| 松滋市| 浪卡子县| 五原县| 延吉市| 延安市| 斗六市| 泾川县|