Add LF5 Aufgaben
This commit is contained in:
14
S1/LF5/2022-02-07_Musterklausur/Aufgabe1.py
Executable file
14
S1/LF5/2022-02-07_Musterklausur/Aufgabe1.py
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
l = []
|
||||
|
||||
while True:
|
||||
try:
|
||||
i = int(input("Eine Zahl: "))
|
||||
except:
|
||||
break
|
||||
|
||||
l.append(i)
|
||||
|
||||
s = sorted(l)
|
||||
print(s)
|
25
S1/LF5/2022-02-07_Musterklausur/Aufgabe2.py
Executable file
25
S1/LF5/2022-02-07_Musterklausur/Aufgabe2.py
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
hs = {}
|
||||
|
||||
print("Bitte Länder eingeben:")
|
||||
|
||||
while True:
|
||||
land = input("Land: ")
|
||||
if land == "":
|
||||
break
|
||||
|
||||
stadt = input("Hauptstadt: ")
|
||||
if stadt == "":
|
||||
break
|
||||
|
||||
hs[land] = stadt
|
||||
|
||||
print("Nun Länder abfragen:")
|
||||
|
||||
while True:
|
||||
land = input("Land: ")
|
||||
if land == "":
|
||||
break
|
||||
|
||||
print(hs[land])
|
7
S1/LF5/2022-02-07_Musterklausur/Aufgabe3.py
Executable file
7
S1/LF5/2022-02-07_Musterklausur/Aufgabe3.py
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
schulden = int(input("Schulden (€): "))
|
||||
zinsen = int(input("Zinsen (%): "))
|
||||
rate = int(input("Monatliche Rate (€): "))
|
||||
|
||||
print("Du bist nach {} Monaten schuldenfrei".format((schulden*((zinsen/100)+1))/rate))
|
23
S1/LF5/2022-02-07_Musterklausur/Aufgabe4.py
Executable file
23
S1/LF5/2022-02-07_Musterklausur/Aufgabe4.py
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
def generatePasswort(name):
|
||||
vokale = "aeiouäöüAEIOUÄÖÜ "
|
||||
|
||||
pw = ""
|
||||
|
||||
for n in name:
|
||||
if n not in vokale:
|
||||
pw += n
|
||||
|
||||
return pw
|
||||
|
||||
tests = [
|
||||
"Isabell Bauer",
|
||||
"Markus Müller",
|
||||
"Annie Claasen",
|
||||
]
|
||||
|
||||
for t in tests:
|
||||
print(t, ":", generatePasswort(t))
|
||||
|
||||
print(generatePasswort(input("Name: ")))
|
Reference in New Issue
Block a user