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
pull/18895/head
Palash Bauri 2018-10-14 02:21:23 +05:30 committed by Quincy Larson
parent 5dcd2785d5
commit 1fe7a36d4a
1 changed files with 7 additions and 0 deletions

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