Update README.md

Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
This commit is contained in:
David Rotermund 2023-12-12 16:27:03 +01:00 committed by GitHub
parent 7534aa65eb
commit 88614efc3a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,6 +23,12 @@ This program does nothing.
</pre> </pre>
{% endraw %} {% endraw %}
In Python:
```python
pass
```
## a+b=c ## a+b=c
{% raw %} {% raw %}
@ -58,3 +64,34 @@ b = int(input())
c = a + b c = a + b
print(c) print(c)
``` ```
## for-loop / while loop
{% raw %}
<pre class="mermaid">
flowchart TD
start([Start]) --> inita{{"counter ← 0"}} --> inita{{"counter_max ← 100"}} --> Condition{"counter < counter_max"}
Condition -- Yes --> printcounter[/"print counter"/] --> Action["counter ← counter + 1"]
Action --> Condition
Condition -- No --> End(End)
</pre>
{% endraw %}
In Python:
```python
counter_max = 100
for counter in range(0, counter_max):
print(counter)
```
or
```python
counter = 0
counter_max = 100
while counter < counter_max:
print(counter)
counter += 1
```