- 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:

推薦閱讀
- 一步一步學Spring Boot 2:微服務項目實戰
- Programming ArcGIS 10.1 with Python Cookbook
- Learning Neo4j 3.x(Second Edition)
- C語言程序設計
- 可解釋機器學習:模型、方法與實踐
- Apache Mahout Clustering Designs
- Python算法指南:程序員經典算法分析與實現
- SQL Server數據庫管理與開發兵書
- Building Microservices with .NET Core
- Learning Hadoop 2
- 精通MySQL 8(視頻教學版)
- C++程序設計教程(第2版)
- 軟件設計模式(Java版)
- Jakarta EE Cookbook
- Mastering R for Quantitative Finance