Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. WYATT - Ranked # 855 with 0.006 %
  2. XAVIER - Ranked # 587 with 0.013 %
  3. YONG - Ranked # 921 with 0.006 %
  4. YOUNG - Ranked # 807 with 0.007 %
  5.  
  6. WYATT
  7. XAVIER
  8. YONG
  9. YOUNG
  10.  
  11. (.*)?[ ]
  12.  
  13. WYATT - Ranked
  14.  
  15. ^w+
  16.  
  17. (firstWord, rest) = yourLine.split(maxsplit=1)
  18.  
  19. In [1]: text = '''WYATT - Ranked # 855 with 0.006 %
  20. ...: XAVIER - Ranked # 587 with 0.013 %
  21. ...: YONG - Ranked # 921 with 0.006 %
  22. ...: YOUNG - Ranked # 807 with 0.007 %'''
  23.  
  24. In [2]: print 'n'.join(line.split()[0] for line in text.split('n'))
  25. WYATT
  26. XAVIER
  27. YONG
  28. YOUNG
  29.  
  30. print line.split()[0]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement