Update README.md
Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
This commit is contained in:
parent
7534aa65eb
commit
88614efc3a
1 changed files with 37 additions and 0 deletions
|
@ -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
|
||||||
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue