marqdo

bool-logicok

keywords/bool-logic.mq.md

Structure

fn · h1main
comment

关键字:TrueFalseNone,以及 and / or / not

bind`a` = True
bind`b` = False
branch
arm`a` and not `b`
call> print text=ok
armelse
call> print text=fail
bind`probe` = 1
branch
armNone
call> print text=none-truthy
armelse
call> print text=none-falsy

Execution

ok none-falsy

Source

---
title: 布尔与逻辑
description: True / False / None 与 and / or / not
---

# main

关键字:`True`、`False`、`None`,以及 `and` / `or` / `not`。

*`a` = True*
*`b` = False*

+ `a` and not `b`
  > print text=ok
+ *
  > print text=fail

*`probe` = 1*

+ None
  > print text=none-truthy
+ *
  > print text=none-falsy