added 1 and 0 as alternative to True/False (#18697)

added example and tip about the use of 1/0 as alternative to True/False
This commit is contained in:
Palash Bauri
2018-10-14 02:21:23 +05:30
committed by Quincy Larson
parent 5dcd2785d5
commit 1fe7a36d4a

View File

@ -17,6 +17,13 @@ x = 5
if x > 4:
print("The condition was true!") #this statement executes
```
> **Tips** : You can use **1** as alternative to **True** and **0** as alternative to **False**
_Example_:
```python
if 1: #true
print('If block will execute!')
```
You can optionally add an `else` response that will execute if the condition is `false`:
```python