Created
September 26, 2017 09:11
-
-
Save airportyh/4da502634e793b0e80eb771c539378be to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sentence = input('Enter a sentence') | |
| new_sentence = '' | |
| for char in sentence: | |
| if char == ' ': | |
| new_sentence = new_sentence + '-' | |
| elif char in '.,': | |
| pass # means do nothing | |
| else: | |
| new_sentence = new_sentence + char | |
| print(new_sentence) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment