Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- text = "Hello! Worl'd?"
- word = ''
- complete = ''
- for c in text:
- if c in ['!', '?', '.', ',', ' ']:
- complete += word + c
- word = ''
- else:
- word = c + word
- complete += word
- print complete
Advertisement
Add Comment
Please, Sign In to add comment