Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 425518f

Browse files
Merge pull request avinashkranjan#2208 from whiteknight16/alpha
NATO Alphabets
2 parents 3994a63 + dff930f commit 425518f

File tree

3 files changed

+59
-0
lines changed

3 files changed

+59
-0
lines changed

‎NATO/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Package/Script Name
2+
3+
Short description of package/script
4+
5+
-You enter a name and returns in form of NATO Phonetic Alphabets
6+
7+
## Setup instructions
8+
9+
No extra library required
10+
11+
## Detailed explanation of script, if needed
12+
13+
## Output
14+
![Demo](image.png)
15+
## Author(s)
16+
17+
Harsh Pandey
18+
19+
## Disclaimers, if any
20+
21+
Use it just for fun

‎NATO/image.png

10.6 KB
Loading[フレーム]

‎NATO/main.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
NATO_phonetic_dict={'A':"Alfa",
2+
"B":"Bravo",
3+
"C":"Charlie",
4+
"D":"Delta",
5+
"E":"Echo",
6+
"F":"Foxtrot",
7+
"G":"Golf",
8+
"H":"Hotel",
9+
"I":"India",
10+
"J":"Juliet",
11+
"K":"Kilo",
12+
"L":"Lima",
13+
"M":"Mike",
14+
"N":"November",
15+
"O":"Oscar",
16+
"P":"Papa",
17+
"Q":"Quebec",
18+
"R":"Romeo",
19+
"S":"Sierra",
20+
"T":"Tango",
21+
"U":"Uniform",
22+
"V":"Victor",
23+
"W":"Whiskey",
24+
"X":"X-ray",
25+
"Y":"Yankee",
26+
"Z":"Zulu"}
27+
28+
def generate_phonetic():
29+
word=input("Enter a word: ")
30+
try:
31+
NATO_phonetic_list=[NATO_phonetic_dict[letter.upper()] for letter in word]
32+
except KeyError:
33+
print("Sorry Only Letters in Alphabets please....")
34+
generate_phonetic()
35+
else:
36+
print(NATO_phonetic_list)
37+
38+
generate_phonetic()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /