Deutsche Zahlen, Sonderzeichen Normal ausgeben
This commit is contained in:
parent
4862164d04
commit
64719a0a60
17
tafel.py
17
tafel.py
@ -29,7 +29,17 @@ buchstabiertafel = {
|
|||||||
"Z": "Zacharias",
|
"Z": "Zacharias",
|
||||||
"Ä": "Ärger",
|
"Ä": "Ärger",
|
||||||
"Ö": "Ökonom",
|
"Ö": "Ökonom",
|
||||||
"Ü": "Übermut"
|
"Ü": "Übermut",
|
||||||
|
"0": "Null",
|
||||||
|
"1": "Eins",
|
||||||
|
"2": "Zwo",
|
||||||
|
"3": "Drei",
|
||||||
|
"4": "Vier",
|
||||||
|
"5": "Fünf",
|
||||||
|
"6": "Sechs",
|
||||||
|
"7": "Sieben",
|
||||||
|
"8": "Acht",
|
||||||
|
"9": "Neun"
|
||||||
}
|
}
|
||||||
|
|
||||||
nato_tafel = {
|
nato_tafel = {
|
||||||
@ -66,7 +76,10 @@ def to_buchstabierfassung(inputstring, tafel=buchstabiertafel):
|
|||||||
output = inputstring + ": "
|
output = inputstring + ": "
|
||||||
for letter in inputstring:
|
for letter in inputstring:
|
||||||
if letter == ' ': continue
|
if letter == ' ': continue
|
||||||
output += tafel[str.upper(letter)] + ' '
|
try:
|
||||||
|
output += tafel[str.upper(letter)] + ' '
|
||||||
|
except KeyError:
|
||||||
|
output += letter + ' '
|
||||||
print(output)
|
print(output)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
Loading…
Reference in New Issue
Block a user