- 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)
推薦閱讀
- 深入理解Android(卷I)
- What's New in TensorFlow 2.0
- 計(jì)算機(jī)圖形學(xué)編程(使用OpenGL和C++)(第2版)
- Apache Hive Essentials
- 技術(shù)領(lǐng)導(dǎo)力:程序員如何才能帶團(tuán)隊(duì)
- Data Analysis with Stata
- Learning Concurrency in Kotlin
- NoSQL數(shù)據(jù)庫(kù)原理
- Programming with CodeIgniterMVC
- Kubernetes進(jìn)階實(shí)戰(zhàn)
- 微信小程序開發(fā)實(shí)戰(zhàn):設(shè)計(jì)·運(yùn)營(yíng)·變現(xiàn)(圖解案例版)
- C#面向?qū)ο蟪绦蛟O(shè)計(jì)(第2版)
- 深度學(xué)習(xí)入門:基于Python的理論與實(shí)現(xiàn)
- Docker on Windows
- Python大數(shù)據(jù)與機(jī)器學(xué)習(xí)實(shí)戰(zhàn)