everything we were supposed to do at school redid at home and uploaded to git

This commit is contained in:
zyqunix 2025-03-20 20:27:56 +01:00
parent 78bbec925b
commit 6b90ee49d0
9 changed files with 77 additions and 0 deletions

View 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;

View 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");

View file

@ -0,0 +1,5 @@
vorname = "Anna";
nachname = "Schmid";
print("Hallo, " + vorname + " " + nachname + "!");
print(f"Hallo, {vorname} {nachname}!");

View 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}");

View 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}");

View file

@ -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}");

View file

@ -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}");

View file

@ -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}");

View file

@ -0,0 +1,4 @@
a = int(input("Zahl 1: "));
b = int(input("Zahl 2: "));
print(f"Potenzieren: {a ** b}");