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

推薦閱讀
- HTML5+CSS3+JavaScript從入門到精通:上冊(微課精編版·第2版)
- CentOS 7 Linux Server Cookbook(Second Edition)
- Internet of Things with the Arduino Yún
- Bootstrap 4:Responsive Web Design
- SAP BusinessObjects Dashboards 4.1 Cookbook
- Gradle for Android
- Microsoft Azure Storage Essentials
- Android應用開發(fā)深入學習實錄
- Hadoop 2.X HDFS源碼剖析
- Android Sensor Programming By Example
- PHP+MySQL動態(tài)網(wǎng)站開發(fā)從入門到精通(視頻教學版)
- Android移動應用開發(fā)項目教程
- Drupal 8 Development:Beginner's Guide(Second Edition)
- Hands-On ROS for Robotics Programming
- 精通Oracle 12c 數(shù)據(jù)庫管理