- Lua Quick Start Guide
- Gabor Szauer
- 101字
- 2021-08-05 10:30:37
Boolean
A boolean variable can have one of two values: true or false. Booleans are often used to control the flow of code and express logic. This code assigns the Boolean value of true to the variable foo, then prints this value:
foo = true
print ("The value of foo is:")
print (foo)
A more useful example of a Boolean is to obtain it from some kind of logical operation, for example, to check whether five is greater than three or not. This code demonstrates how to do this:
result = 5 > 3
print ("Is 5 > 3?")
print (result)
推薦閱讀
- Photoshop智能手機(jī)APP UI設(shè)計之道
- Xamarin.Forms Projects
- Ext JS 4 Web Application Development Cookbook
- Go并發(fā)編程實戰(zhàn)
- Learning Concurrency in Kotlin
- 深入剖析Java虛擬機(jī):源碼剖析與實例詳解(基礎(chǔ)卷)
- Microsoft 365 Certified Fundamentals MS-900 Exam Guide
- Mastering Docker
- PhoneGap 4 Mobile Application Development Cookbook
- Apache Solr PHP Integration
- Java語言程序設(shè)計與實現(xiàn)(微課版)
- C#編程魔法書
- 羅布樂思開發(fā)官方指南:Lua 語言編程
- Visual C++ 2017網(wǎng)絡(luò)編程實戰(zhàn)
- C#入門經(jīng)典(第7版):C# 6.0 & Visual Studio 2015(.NET開發(fā)經(jīng)典名著)