Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. import re
  2. p_confrontations = 'Totally, 7 game(s) over, 8 game(s) under 7 game(s) half-game over, 8'
  3. over_under = re.findall(r'Totally, (\d+) game\(s\) over, (\d+)', p_confrontations)
  4. over_under_ratio = int(over_under[0][0])/(int(over_under[0][0])+int(over_under[0][1]))
  5. over_under2 = re.findall(r'(\d+) game\(s\) half-game over, (\d+)', p_confrontations)
  6. over_under2_ratio = int(over_under2[0][0])/(int(over_under2[0][0])+int(over_under2[0][1]))
  7. head_to_heads = dict()
  8. head_to_heads['over/under 0.75'] = over_under_ratio
  9. head_to_heads['over/under 2.5'] = over_under2_ratio
  10. print(head_to_heads)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement