- Lua Quick Start Guide
- Gabor Szauer
- 101字
- 2021-08-05 10:30:37
String literals
A string literal must be written between quotes. The following line of code demonstrates a string literal. This example does not do anything since the literal is a value that is never assigned to a variable:
"hello, world"
Without being assigned to a variable, this string can't be printed. String literals don't have to be assigned to a variable to be useful; they can be passed directly to a function such as print. The following code demonstrates both of these cases:
print ("Print a string literal, used in place")
message = "Print a string assigned to a variable"
print(message)
推薦閱讀
- 高手是如何做產品設計的(全2冊)
- React.js Essentials
- SQL Server從入門到精通(第3版)
- Android Wear Projects
- Learning Material Design
- OpenCV 3 Blueprints
- 微課學人工智能Python編程
- Managing Microsoft Hybrid Clouds
- 超簡單:Photoshop+JavaScript+Python智能修圖與圖像自動化處理
- Java 9 with JShell
- Spark技術內幕:深入解析Spark內核架構設計與實現原理
- RESTful Web API Design with Node.js(Second Edition)
- 面向對象程序設計及C++實驗指導(第3版)
- Twitter Bootstrap Web Development How-to
- JSP項目開發情境教程