Create README.md

Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
This commit is contained in:
David Rotermund 2023-12-06 23:32:05 +01:00 committed by GitHub
parent 9d50e56e31
commit ca8956cfdd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,37 @@
# Flow Control if, elif, else
{:.no_toc}
<nav markdown="1" class="toc-class">
* TOC
{:toc}
</nav>
## The goal
If I would have...
Questions to [David Rotermund](mailto:davrot@uni-bremen.de)
**Logic blocks need to be indented. Preferable with 4 spaces!**
## [The if statement](https://docs.python.org/3/reference/compound_stmts.html#the-if-statement)
```python
if i == 1:
print("if")
elif i == 2:
print("elif brach A")
elif i == 3:
print("elif brach B")
else:
print("else -- default")
```
## The full statement
```python
if_stmt ::= "if" assignment_expression ":" suite
("elif" assignment_expression ":" suite)*
["else" ":" suite]
```