Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- nato_words = ['Alfa', 'Bravo', 'Charlie', 'Delta', 'Echo', 'Foxtrot', 'Golf', 'Hotel', 'India', 'Juliet', 'Kilo',
- 'Lima', 'Mike', 'November', 'Oscar', 'Papa', 'Quebec', 'Romeo', 'Sierra', 'Tango', 'Uniform', 'Victor',
- 'Whiskey', 'X-ray', 'Yankee', 'Zulu']
- def nato_convert(word):
- letter_index = [ord(i.lower()) - 96 for i in word if i.isalpha()]
- conversion = [nato_words[i - 1] for i in letter_index]
- print(*conversion, sep=', ')
- nato_convert('Hello Friend')
Advertisement
Add Comment
Please, Sign In to add comment