Buchstabiertafel konverter

This commit is contained in:
Felix Pankratz 2020-11-06 12:44:51 +01:00
commit cd6b82ffbf

54
tafel.py Executable file
View File

@ -0,0 +1,54 @@
#!/usr/bin/env python3
buchstabiertafel = {
"A": "Anton",
"B": "Berta",
"C": "Cäsar",
"D": "Dora",
"E": "Emil",
"F": "Friedrich",
"G": "Gustav",
"H": "Heinrich",
"I": "Ida",
"J": "Julius",
"K": "Kaufmann",
"L": "Ludwig",
"M": "Martha",
"N": "Nordpol",
"O": "Otto",
"P": "Paula",
"Q": "Quelle",
"R": "Richard",
"S": "Siegfried",
"T": "Theodor",
"U": "Ulrich",
"V": "Viktor",
"W": "Wilhelm",
"X": "Xanthippe",
"Y": "Ypsilon",
"Z": "Zacharias",
"Ä": "Ärger",
"Ö": "Ökonom",
"Ü": "Übermut"
}
def to_buchstabierfassung(inputstring):
output = inputstring + ": "
for letter in inputstring:
if letter == ' ': continue
output += buchstabiertafel[str.upper(letter)] + ' '
print(output)
def main():
import sys
if len(sys.argv) < 2:
to_buchstabierfassung("highQ")
to_buchstabierfassung("Computerlösungen")
print()
to_buchstabierfassung("Felix")
to_buchstabierfassung("Pankratz")
else:
for word in sys.argv[1:]:
to_buchstabierfassung(word)
if __name__ == '__main__':
main()