Skip to content

Instantly share code, notes, and snippets.

@venkatsgithub1
Created April 14, 2017 11:52
Show Gist options
  • Save venkatsgithub1/d975ec6ce59712a2a6b3eb1397480669 to your computer and use it in GitHub Desktop.
Save venkatsgithub1/d975ec6ce59712a2a6b3eb1397480669 to your computer and use it in GitHub Desktop.
# The Gist discusses on how to create a simple dictonary in Python.
nato_alphabet={
"A":"Alpha",
"B":"Beta",
"C":"Charlie",
"D":"Delta",
"E":"Echo",
"F":"Foxtrot",
"G":"Golf",
"H":"Hotel",
"I":"India",
"J":"Juliett",
"K":"Kilo",
"L":"Lima",
"M":"Mike",
"N":"November",
"O":"Oscar",
"P":"Papa",
"Q":"Qubec",
"R":"Romeo",
"S":"Sierra",
"T":"Tango",
"U":"Uniform",
"V":"Victor",
"W":"Whisky",
"X":"Xray",
"Y":"Yankee",
"Z":"Zulu"
}
def giveMeAWord (word):
convStr=""
for char in word.upper():
convStr+=nato_alphabet[char]
return convStr
print (giveMeAWord("string"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment