Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
lehrkraefte:snr:informatik:python:ersteschritte [2021/09/01 11:10] Olaf Schnürer [Formatierte Strings] |
lehrkraefte:snr:informatik:python:ersteschritte [2022/08/27 23:01] (current) Olaf Schnürer [Rechnen mit Variablen] |
||
---|---|---|---|
Line 116: | Line 116: | ||
<WRAP round info> | <WRAP round info> | ||
- | Variablen muss ein Startwert | + | Variablen muss ein Startwert |
<code python> | <code python> | ||
a = 7 | a = 7 | ||
Line 182: | Line 182: | ||
<code python> | <code python> | ||
a = inputInt(" | a = inputInt(" | ||
- | print(" | + | print(" |
</ | </ | ||
Gib im zweiten Programm bewusst ein Wort statt einer Zahl ein! Was ändert sich bei der Ausführung, | Gib im zweiten Programm bewusst ein Wort statt einer Zahl ein! Was ändert sich bei der Ausführung, | ||
Line 188: | Line 188: | ||
===== Formatierte Strings ===== | ===== Formatierte Strings ===== | ||
+ | |||
+ | (Relativ schwierig: Nächstes Mal als Ziel Syntax wie < | ||
+ | |||
<WRAP round todo> | <WRAP round todo> | ||
Teste den folgenden Code. | Teste den folgenden Code. | ||
Line 205: | Line 208: | ||
a = 5 | a = 5 | ||
- | print(" | + | print(" |
print("" | print("" | ||
Line 215: | Line 218: | ||
<WRAP round info> | <WRAP round info> | ||
- | Der Operator '' | + | Der Operator '' |
Die '' | Die '' | ||
Line 228: | Line 231: | ||
<code python> | <code python> | ||
ff = 3.1415926535 | ff = 3.1415926535 | ||
- | print(" | + | print(" |
- | print(" | + | print(" |
- | print(" | + | print(" |
- | print(" | + | print(" |
- | print(" | + | print(" |
</ | </ | ||
</ | </ | ||
Line 282: | Line 285: | ||
</ | </ | ||
</ | </ | ||
+ | |||
+ | 2dNP bis hier am 01.09.2021 | ||
===== Expertenwissen: | ===== Expertenwissen: | ||
Line 308: | Line 313: | ||
</ | </ | ||
+ | <hidden BMI-Berechnung> | ||
+ | <code python> | ||
+ | g = inputInt(" | ||
+ | m = inputInt(" | ||
+ | h = g/100 # Grösse in m | ||
+ | BMI = m / (h**2) | ||
+ | print(" | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== Link zur Kursseite ===== | ||
+ | [[lehrkraefte: | ||