modified
This commit is contained in:
1 parent
d327f5d7e6
commit
8431a9955a
4 files changed
+4
-13
No files matched your search
+2
-2
@@ -2,6 +2,6 @@ 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
|
||||
|
||||
#assert total_length == 6 + 5 + 6 + 4 # Kuchen (6) + Katze (5) + Kaffee (6) + Kino (4) = 21
|
||||
Reference in new issue
Block a user