Code: Alles auswählen
def most_frequent(text):
counter = 0
num = text[0]
for i in text:
curr_frequency = text.count(i)
if(curr_frequency > counter):
counter = curr_frequency
num = i
return num
print(most_frequent(text))
haeufigstes = (most_frequent)
haeufigstes1 = haeufigstes[0]
for c in text:
count = 0
haeufigstebuchstaben = ["e", "n", "i", "s", "r", "a", "t", "d", "h", "u", "l", "c", "g", "m" "o", "b", "w", "f", "k", "z", "p", "v", "j", "y", "x", "q"]
haeufigsterbuchstabegerade = haeufigstebuchstaben[count]
print(haeufigsterbuchstabegerade)
testloesungsbuchstabe = ord(haeufigstes1[0]) - ord(haeufigsterbuchstabegerade[0])
print(testloesungsbuchstabe)