You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
604 B
Markdown
51 lines
604 B
Markdown
# Boolean výrazy
|
|
|
|
Boolean výrazy jsou výrazy které vracejí dvě možné hodnoty : `True` nebo `False`.
|
|
|
|
## Operátory
|
|
|
|
### `<`, `>` - menší než, větší než
|
|
```python
|
|
>>> 2 < 3
|
|
True
|
|
>>> 2 > 3
|
|
False
|
|
```
|
|
|
|
### `==`, `!=` - rovnost, nerovnost
|
|
|
|
```python
|
|
>>> 2 == 2
|
|
True
|
|
>>> 2 != 3
|
|
True
|
|
```
|
|
|
|
### `and`, `or` - logické 'a' a 'nebo'
|
|
|
|
```python
|
|
>>> True and True
|
|
True
|
|
>>> True and False # a obracene
|
|
False
|
|
>>> False and False
|
|
False
|
|
```
|
|
```python
|
|
>>> True or True
|
|
True
|
|
>>> True or False # a obracene
|
|
True
|
|
>>> False or False
|
|
```
|
|
|
|
### `not` - negace
|
|
|
|
```python
|
|
>>> not True
|
|
False
|
|
>>> not False
|
|
True
|
|
```
|
|
|