everything we were supposed to do at school redid at home and uploaded to git
This commit is contained in:
parent
78bbec925b
commit
6b90ee49d0
9 changed files with 77 additions and 0 deletions
15
bedingungen/passwortueberpruefung.py
Normal file
15
bedingungen/passwortueberpruefung.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
passwort = "1234";
|
||||
versuche = 0;
|
||||
|
||||
while True:
|
||||
if versuche < 3:
|
||||
inp = input("Passwort: ");
|
||||
if inp == passwort:
|
||||
print("Zugriff gewährt");
|
||||
break;
|
||||
else:
|
||||
print("Zugriff verweigert");
|
||||
versuche += 1;
|
||||
else:
|
||||
print("Mehr als 3 Versuche.\nZugriff gesperrt.");
|
||||
break;
|
12
bedingungen/temperaturanzeige.py
Normal file
12
bedingungen/temperaturanzeige.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
temp = float(input("Temperatur: "));
|
||||
|
||||
if temp < 0:
|
||||
print("Es ist eiskalt.");
|
||||
elif temp >= 0 and temp <= 10:
|
||||
print("Es ist kalt.");
|
||||
elif temp > 11 and temp <= 20:
|
||||
print("Es ist angenehm");
|
||||
elif temp > 21 and temp <= 30:
|
||||
print("Es ist warm");
|
||||
elif temp > 30:
|
||||
print("Es ist heiss");
|
5
einfuehrung/Namenseingabe.py
Normal file
5
einfuehrung/Namenseingabe.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
vorname = "Anna";
|
||||
nachname = "Schmid";
|
||||
|
||||
print("Hallo, " + vorname + " " + nachname + "!");
|
||||
print(f"Hallo, {vorname} {nachname}!");
|
11
mathematik/grundrechenarten_2.py
Normal file
11
mathematik/grundrechenarten_2.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
a = 20;
|
||||
b = 5;
|
||||
c = 3;
|
||||
|
||||
print(f"a: {a} \nb: {b} \nc: {c}\n");
|
||||
print(f"Addition: {a + b + c}");
|
||||
print(f"Subtraktion: {b + c - a}");
|
||||
print(f"Multiplikation: {a * b * c}");
|
||||
print(f"Division: {a / (b + c)}");
|
||||
print(f"Modulo: {a % c}");
|
||||
print(f"Potenzierung: {a ** c}");
|
9
mathematik/kombination_aller_grundrechenarten.py
Normal file
9
mathematik/kombination_aller_grundrechenarten.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
a = 20;
|
||||
b = 4;
|
||||
|
||||
print(f"Addition: {a + b}");
|
||||
print(f"Subtraktion: {a - b}");
|
||||
print(f"Multiplikation: {a * b}");
|
||||
print(f"Division: {a / b}");
|
||||
print(f"Modulo: {a % b}");
|
||||
print(f"Potenzierung: {a ** b}");
|
|
@ -0,0 +1,5 @@
|
|||
a = int(input("Zahl 1: "));
|
||||
b = int(input("Zahl 2: "));
|
||||
|
||||
print(f"Ganzzahlige Division: {a // b}");
|
||||
print(f"Modulo: {a % b}");
|
|
@ -0,0 +1,8 @@
|
|||
a = int(input("Zahl 1: "));
|
||||
b = int(input("Zahl 2: "));
|
||||
|
||||
print(f"a: {a} \nb: {b} \n");
|
||||
print(f"Addition: {a + b}");
|
||||
print(f"Subtraktion: {a - b}");
|
||||
print(f"Multiplikation: {a * b}");
|
||||
print(f"Division: {a / b}");
|
|
@ -0,0 +1,8 @@
|
|||
a = float(input("Zahl 1: "));
|
||||
b = float(input("Zahl 2: "));
|
||||
|
||||
print(f"a: {a} \nb: {b} \n");
|
||||
print(f"Addition: {a + b}");
|
||||
print(f"Subtraktion: {a - b}");
|
||||
print(f"Multiplikation: {a * b}");
|
||||
print(f"Division: {a / b}");
|
4
variablen_und_datentypen/potenzierung_von_zahlen.py
Normal file
4
variablen_und_datentypen/potenzierung_von_zahlen.py
Normal file
|
@ -0,0 +1,4 @@
|
|||
a = int(input("Zahl 1: "));
|
||||
b = int(input("Zahl 2: "));
|
||||
|
||||
print(f"Potenzieren: {a ** b}");
|
Loading…
Add table
Reference in a new issue