-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathnatoalphabet.py
More file actions
44 lines (40 loc) · 754 Bytes
/
natoalphabet.py
File metadata and controls
44 lines (40 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/python3
import sys
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'
}
try:
sys.argv[1]
except:
print("Usage: natoalphabet.py <word>")
exit(1)
for letter in sys.argv[1]:
if letter.lower() not in nato_alphabet:
print(letter)
else:
print(nato_alphabet[letter])