Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WYATT - Ranked # 855 with 0.006 %
- XAVIER - Ranked # 587 with 0.013 %
- YONG - Ranked # 921 with 0.006 %
- YOUNG - Ranked # 807 with 0.007 %
- WYATT
- XAVIER
- YONG
- YOUNG
- (.*)?[ ]
- WYATT - Ranked
- ^w+
- (firstWord, rest) = yourLine.split(maxsplit=1)
- In [1]: text = '''WYATT - Ranked # 855 with 0.006 %
- ...: XAVIER - Ranked # 587 with 0.013 %
- ...: YONG - Ranked # 921 with 0.006 %
- ...: YOUNG - Ranked # 807 with 0.007 %'''
- In [2]: print 'n'.join(line.split()[0] for line in text.split('n'))
- WYATT
- XAVIER
- YONG
- YOUNG
- print line.split()[0]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement