#2
10.12.2016 um 20:46 Uhr
Hallo,
Tatsache, war ich wohl etwas unachtsam.
Bis auf die Mehrwortübersetzung hab ich es aber jetzt soweit geschafft:
word = input("Zu uebersetzendes Wort: ")
vocals = 'A, E, I, O, U, a, e, i, o, u'
consonants = 'B, b, C, c, D, c, F, f, G, g, H, h, J, j, K, k, L, l, M, m, N, n, P, p, Q, q, R, r, S, s, T, t, V, v, W, w, X, x, Y, y, Z, z'
if word[0] in vocals:
word = word + "ay"
elif word[0] and word[1] in consonants:
word = word[2:] + word[0] + word[1] + "ay"
elif word[0] in consonants and word[1] == 'u':
word = word[2:] + word[0] + word[1] + "ay"
else:
word = word[1:] + word[0] + "ay"
print(word)
P.s.: Bei Kommentare kann wohl kein Python-Code gewählt werden...
386 0