"""Lab 10: spell and count the characters of a string.

Author: YOUR NAME
Version: THE DATE
"""

NATO = {
    "a": "Alfa",
    "b": "Bravo",
    "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": "Quebec",
    "r": "Romeo",
    "s": "Sierra",
    "t": "Tango",
    "u": "Uniform",
    "v": "Victor",
    "w": "Whiskey",
    "x": "X-ray",
    "y": "Yankee",
    "z": "Zulu",
}


def spell(word: str) -> list[str]:
    """Spell a word with the NATO phonetic alphabet.

    Args:
        word: The word to spell.

    Returns:
        A new list with one entry for each character of the word: the code
        word for that character if it is a key of NATO, or else the character
        itself, unchanged. Ex: spell("r2d2") returns ["Romeo", "2", "Delta",
        "2"], and spell("Bob") returns ["B", "Oscar", "Bravo"].
    """


def char_counts(text: str) -> dict[str, int]:
    """Count how many times each character appears in a string.

    Args:
        text: The string to count.

    Returns:
        A new dictionary that maps each character of the text to the number
        of times it appears. Every character is counted, including spaces and
        punctuation, and "A" and "a" are counted separately. Ex:
        char_counts("noon") returns {"n": 2, "o": 2}.
    """


def is_anagram(word1: str, word2: str) -> bool:
    """Decide whether two words are made of exactly the same characters.

    Args:
        word1: The first word.
        word2: The second word.

    Returns:
        True if every character appears the same number of times in both
        words, or else False. Ex: is_anagram("listen", "silent") returns True,
        and is_anagram("aab", "abb") returns False.
    """


if __name__ == "__main__":
    print(spell("r2d2"))
    print(char_counts("noon"))
    print(is_anagram("listen", "silent"))
