- 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)
推薦閱讀
- 數(shù)據(jù)庫系統(tǒng)原理及MySQL應(yīng)用教程(第2版)
- Instant Testing with CasperJS
- Java面向?qū)ο蟪绦蜷_發(fā)及實(shí)戰(zhàn)
- Access 2010數(shù)據(jù)庫基礎(chǔ)與應(yīng)用項(xiàng)目式教程(第3版)
- Effective Python Penetration Testing
- PhoneGap:Beginner's Guide(Third Edition)
- Mastering Data Mining with Python:Find patterns hidden in your data
- Python爬蟲、數(shù)據(jù)分析與可視化:工具詳解與案例實(shí)戰(zhàn)
- Learning YARN
- 響應(yīng)式Web設(shè)計(jì):HTML5和CSS3實(shí)戰(zhàn)(第2版)
- FFmpeg開發(fā)實(shí)戰(zhàn):從零基礎(chǔ)到短視頻上線
- Keil Cx51 V7.0單片機(jī)高級(jí)語言編程與μVision2應(yīng)用實(shí)踐
- Learning Dynamics NAV Patterns
- R語言:邁向大數(shù)據(jù)之路
- PHP程序設(shè)計(jì)經(jīng)典300例