aufgabe1_codewars #2

Open
ramushileart wants to merge 2 commits from aufgabe1_codewars into main
Showing only changes of commit 0a4b81b1cb - Show all commits

View File

@ -0,0 +1,14 @@
# Abgabe - Counting Duplicates Aufgabe von Codewars
# Link dazu: https://www.codewars.com/kata/54bf1c2cd5b56cc47f0007a1
# Leart Ramushi
def duplicate_count(text):
lower_text = text.lower()
letter_set = set()
for i in range(len(lower_text)):
if lower_text.count(lower_text[i]) > 1:
letter_set.add(lower_text[i])
return len(letter_set)