Text to NATO Phonetic Alphabet
Convert any text to the NATO phonetic alphabet for clear verbal communication.
TextToNato.result
HotelEchoLimaLimaOscar[Space]WhiskeyOscarRomeoLimaDelta
Hotel · Echo · Lima · Lima · Oscar · [Space] · Whiskey · Oscar · Romeo · Lima · Delta
TextToNato.referenceTable
AAlpha
BBravo
CCharlie
DDelta
EEcho
FFoxtrot
GGolf
HHotel
IIndia
JJuliet
KKilo
LLima
MMike
NNovember
OOscar
PPapa
QQuebec
RRomeo
SSierra
TTango
UUniform
VVictor
WWhiskey
XX-ray
YYankee
ZZulu
0Zero
1One
2Two
3Three
4Four
5Five
6Six
7Seven
8Eight
9Nine
TextToNato.clickHint
Domande Frequenti
Implementazione del Codice
NATO_ALPHABET = {
'A': 'Alpha', 'B': 'Bravo', 'C': 'Charlie', 'D': 'Delta', 'E': 'Echo',
'F': 'Foxtrot', 'G': 'Golf', 'H': 'Hotel', 'I': 'India', 'J': 'Juliet',
'K': 'Kilo', 'L': 'Lima', 'M': 'Mike', 'N': 'November', 'O': 'Oscar',
'P': 'Papa', 'Q': 'Quebec', 'R': 'Romeo', 'S': 'Sierra', 'T': 'Tango',
'U': 'Uniform', 'V': 'Victor', 'W': 'Whiskey', 'X': 'X-ray', 'Y': 'Yankee',
'Z': 'Zulu',
'0': 'Zero', '1': 'One', '2': 'Two', '3': 'Three', '4': 'Four',
'5': 'Five', '6': 'Six', '7': 'Seven', '8': 'Eight', '9': 'Nine',
}
def text_to_nato(text: str) -> str:
words = []
for char in text.upper():
if char in NATO_ALPHABET:
words.append(NATO_ALPHABET[char])
elif char == ' ':
words.append('[Space]')
else:
words.append(f'[{char}]')
return ' · '.join(words)
print(text_to_nato("Hello World"))
# Hotel · Echo · Lima · Lima · Oscar · [Space] · Whiskey · Oscar · Romeo · Lima · DeltaComments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.