- 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)
推薦閱讀
- CMDB分步構建指南
- 軟件架構設計:大型網站技術架構與業務架構融合之道
- Three.js開發指南:基于WebGL和HTML5在網頁上渲染3D圖形和動畫(原書第3版)
- FFmpeg入門詳解:音視頻流媒體播放器原理及應用
- Instant 960 Grid System
- C語言程序設計
- C#應用程序設計教程
- Creating Stunning Dashboards with QlikView
- Visual Basic程序設計上機實驗教程
- Extreme C
- IoT Projects with Bluetooth Low Energy
- Learning Python Data Visualization
- Distributed Computing with Python
- Qt編程快速入門
- Learning Yeoman