Skip to content

Commit 9a9dc95

Browse files
committed
fix: improve Morse code parsing by handling extra whitespace
1 parent ac2ac22 commit 9a9dc95

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

utilities/Text-to-Morse/Text-to-Morse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
elif choice == '2':
4444
morse_input = input("\n📻 Enter Morse code (separate letters with space, words with ' / '): ")
45-
morse_chars = morse_input.split(' ')
45+
morse_chars = morse_input.strip().split()
4646
text_result = []
4747

4848
for code in morse_chars:

0 commit comments

Comments
 (0)