I have a small problem with something I need to do in school...
My task is the get a raw input string from a user (text = raw_input()) and I need to pri
text = raw_input()
Some might say, there is never too many answer's using regular expressions (in this case, this looks like the worst solutions..):
>>> import re >>> string = "Hello SO user, How are you" >>> matches = re.findall(r'^\w+|\w+$', string) >>> print(matches) ['Hello', 'you']