This commit is contained in:
englingvi103466 committed 2026-10-29 13:17:57 +01:00
1 parent b17db7bc39
commit d327f5d7e6
7 files changed
+132

No files matched your search

+7
View File
@@ -0,0 +1,7 @@
words = ["Kuchen", "Katze", "Apfel", "Kaffee", "Baum", "Kino"]
# Einzeiler kombiniert filter, map und sum
total_length = sum(map(len, filter(lambda w: w.lower().startswith('k'), words)))
print("Gesamtlänge aller K-Wörter:", total_length)
assert total_length == 6 + 5 + 6 + 4 # Kuchen (6) + Katze (5) + Kaffee (6) + Kino (4) = 21