Python 3 - How to capitalize first letter of every sentence when translating from morse code
- 阅读更多 关于 Python 3 - How to capitalize first letter of every sentence when translating from morse code
问题 I am trying to translate morse code into words and sentences and it all works fine... except for one thing. My entire output is lowercased and I want to be able to capitalize every first letter of every sentence. This is my current code: text = input() if is_morse(text): lst = text.split(" ") text = "" for e in lst: text += TO_TEXT[e].lower() print(text) Each element in the split list is equal to a character (but in morse) NOT a WORD. 'TO_TEXT' is a dictionary. Does anyone have a easy