Implement the assignment's generate_phonetic: it prompts for a word, builds the code words with a list comprehension inside a try block, catches the KeyError of a character that is not a letter, tells the user to enter letters of the alphabet only, and loops until the input is valid. The lookup and the prompt sit behind ports so the layers stay separate.
Phase: MIL-002
Reference: UC-001
Implement the assignment's `generate_phonetic`: it prompts for a word, builds the code words with a list comprehension inside a `try` block, catches the `KeyError` of a character that is not a letter, tells the user to enter letters of the alphabet only, and loops until the input is valid. The lookup and the prompt sit behind ports so the layers stay separate.
Phase: MIL-002
Reference: UC-001
Tirsvad
added this to the MIL-002 NATO converter milestone 2026-10-14 13:31:39 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Implement the assignment's
generate_phonetic: it prompts for a word, builds the code words with a list comprehension inside atryblock, catches theKeyErrorof a character that is not a letter, tells the user to enter letters of the alphabet only, and loops until the input is valid. The lookup and the prompt sit behind ports so the layers stay separate.Phase: MIL-002
Reference: UC-001