Update README.md
Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
This commit is contained in:
parent
dce41a44e2
commit
95e94c3353
1 changed files with 29 additions and 0 deletions
|
@ -35,3 +35,32 @@ if_stmt ::= "if" assignment_expression ":" suite
|
||||||
["else" ":" suite]
|
["else" ":" suite]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## if, elif, else with lists
|
||||||
|
|
||||||
|
```python
|
||||||
|
A = 1
|
||||||
|
if A in [0, 2, 4, 6, 8]:
|
||||||
|
print("found")
|
||||||
|
else:
|
||||||
|
print("NOT found")
|
||||||
|
```
|
||||||
|
|
||||||
|
Output
|
||||||
|
|
||||||
|
```python
|
||||||
|
NOT found
|
||||||
|
```
|
||||||
|
|
||||||
|
```python
|
||||||
|
A = 2
|
||||||
|
if A in [0, 2, 4, 6, 8]:
|
||||||
|
print("found")
|
||||||
|
else:
|
||||||
|
print("NOT found")
|
||||||
|
```
|
||||||
|
|
||||||
|
Output
|
||||||
|
|
||||||
|
```python
|
||||||
|
found
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in a new issue