- 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)
推薦閱讀
- 垃圾回收的算法與實現
- C/C++算法從菜鳥到達人
- Instant Typeahead.js
- 深入理解Java7:核心技術與最佳實踐
- Mastering Drupal 8 Views
- Instant PHP Web Scraping
- Practical Microservices
- Python自然語言理解:自然語言理解系統開發與應用實戰
- AngularJS UI Development
- HTML5 WebSocket權威指南
- Building Scalable Apps with Redis and Node.js
- 深度學習的數學:使用Python語言
- 軟件測試項目實戰之功能測試篇
- Java語言程序設計與實現(微課版)
- Clojure High Performance Programming