- Lua Quick Start Guide
- Gabor Szauer
- 104字
- 2021-08-05 10:30:36
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:

推薦閱讀
- OpenStack Cloud Computing Cookbook(Third Edition)
- 數據結構(Python語言描述)(第2版)
- R語言編程指南
- Building Mapping Applications with QGIS
- Yocto for Raspberry Pi
- Drupal 8 Module Development
- Visual C++開發寶典
- 軟技能2:軟件開發者職業生涯指南
- 菜鳥成長之路
- Analytics for the Internet of Things(IoT)
- 鋁合金陽極氧化與表面處理技術(第三版)
- JavaWeb入門經典
- 區塊鏈原理與技術應用
- Xamarin Mobile Application Development for iOS
- Getting Started with Oracle WebLogic Server 12c:Developer’s Guide