diff --git a/src/cli.py b/src/cli.py index 7f0b35e..469a13f 100644 --- a/src/cli.py +++ b/src/cli.py @@ -92,10 +92,9 @@ def beautify(words: list[str]): new_beautiful_string = [] for num, letter in enumerate(message): - if letter in string.ascii_letters: - if num % 2: - letter = flip_char(letter) - new_beautiful_string.append(letter) + if num % 2: + letter = flip_char(letter) + new_beautiful_string.append(letter) click.echo("".join(new_beautiful_string)) diff --git a/src/helpers.py b/src/helpers.py index fd594ff..c038a0c 100644 --- a/src/helpers.py +++ b/src/helpers.py @@ -2,6 +2,9 @@ import string def flip_char(char: str): + if char.lower() not in string.ascii_letters: + return char + if char in string.ascii_lowercase: return string.ascii_uppercase[string.ascii_lowercase.find(char)] else: