Skip to content

Commit 87d7947

Browse files
Merge pull request #306 from Gaurav-2803/patch-1
Inline condition in encrypted fn
2 parents e8aad5b + 9d57944 commit 87d7947

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)