官术网_书友最值得收藏!

  • 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)
主站蜘蛛池模板: 福清市| 太湖县| 沅陵县| 永修县| 喀喇| 庄河市| 仙游县| 临安市| 获嘉县| 桐乡市| 容城县| 乌海市| 石林| 剑河县| 正安县| 正安县| 怀宁县| 保亭| 玛曲县| 广水市| 闵行区| 阿拉尔市| 东莞市| 玉山县| 东安县| 巴彦淖尔市| 达拉特旗| 屯门区| 县级市| 遂平县| 吴桥县| 绥宁县| 达孜县| 长汀县| 澄城县| 江西省| 湘乡市| 那坡县| 民和| 金沙县| 手游|