- Lua Quick Start Guide
- Gabor Szauer
- 93字
- 2021-08-05 10:30:38
Console input
Doing interesting things with code usually requires some kind of input from a user. Input from the console can be obtained with the io.read() function. Unlike the functions used previously, nothing goes inside the parentheses of this one. The function will read one line of input from the user when the user presses Enter. The function returns this line of text as a string, which can be stored in a variable. The following example demonstrates this:
print ("Please enter your name:")
name = io.read()
print ("Hello " .. name)
推薦閱讀
- Learning Neo4j
- Python科學(xué)計(jì)算(第2版)
- 潮流:UI設(shè)計(jì)必修課
- Python入門很簡(jiǎn)單
- SQL for Data Analytics
- 精通網(wǎng)絡(luò)視頻核心開發(fā)技術(shù)
- Elasticsearch for Hadoop
- 低代碼平臺(tái)開發(fā)實(shí)踐:基于React
- Visual Basic程序設(shè)計(jì)上機(jī)實(shí)驗(yàn)教程
- C和C++游戲趣味編程
- Python 3.7從入門到精通(視頻教學(xué)版)
- Scala編程(第5版)
- Qt5 C++ GUI Programming Cookbook
- 代碼閱讀
- 軟件工程與UML案例解析(第三版)