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
5 years ago
|
# Boolean výrazy
|
||
|
|
||
|
Boolean výrazy jsou výrazy které vracejí dvě možné hodnoty : `True` nebo `False`.
|
||
|
|
||
|
## Operátory
|
||
|
|
||
5 years ago
|
### `<`, `>` - menší než, větší než
|
||
5 years ago
|
```python
|
||
|
>>> 2 < 3
|
||
|
True
|
||
|
>>> 2 > 3
|
||
|
False
|
||
|
```
|
||
5 years ago
|
|
||
|
### `==`, `!=` - 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
|
||
|
```
|
||
|
|