Skip to content

Commit 9d57944

Browse files
authored
Inline condition in encrypted fn
1 parent eb9d774 commit 9d57944

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Morse Code/encrypter-decrypter.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,8 @@
2020
def encrypt(message):
2121
cipher = ''
2222
for letter in message:
23-
if letter != ' ':
24-
cipher += MORSE_CODE_DICT[letter] + ' '
25-
else:
26-
cipher += ' '
27-
23+
cipher += MORSE_CODE_DICT[letter] + ' ' if letter != ' ' else ' '
24+
2825
return cipher
2926

3027

0 commit comments

Comments
 (0)