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

推薦閱讀
- 自然語言處理實戰(zhàn):預(yù)訓(xùn)練模型應(yīng)用及其產(chǎn)品化
- 兩周自制腳本語言
- Practical Internet of Things Security
- YARN Essentials
- Quarkus實踐指南:構(gòu)建新一代的Kubernetes原生Java微服務(wù)
- Nginx實戰(zhàn):基于Lua語言的配置、開發(fā)與架構(gòu)詳解
- Mastering ROS for Robotics Programming
- Internet of Things with ESP8266
- SQL Server 入門很輕松(微課超值版)
- C語言程序設(shè)計實驗指導(dǎo)與習(xí)題精解
- C# 10核心技術(shù)指南
- PHP程序設(shè)計經(jīng)典300例
- Mastering Puppet(Second Edition)
- 開源心法
- 構(gòu)建跨平臺APP:響應(yīng)式UI設(shè)計入門