Hole | Wins | Losses | Score | +12 |
---|---|---|---|---|
1 | 36 | 45 | +9 | (E) |
10 | 42 | 39 | +12 | (E) |
Avg | 39 | 42 | +38 |
The data provided appears to be a large text file containing the results of sports games, specifically baseball games. The format of the data is not explicitly stated, but it seems to follow a simple format where each line represents a game result.
Here's a Python script that can parse this data and provide some basic statistics:
import re
class GameResult:
def __init__(self):
self.results = {}
def add_game(self, team1, score1, team2, score2):
self.results[team1] = (score1, team2, score2)
def load_data(data):
results = GameResult()
for line in data.split('\n'):
if line:
# Use regular expression to extract scores and teams
match = re.match(r'(\d+) - (\d+)', line)
if match:
score1, score2 = map(int, match.groups())
team1, team2 = line.split('-')[0].strip(), line.split('-')[1].split()[0]
results.add_game(team1, score1, team2, score2)
return results
def print_results(results):
for team, result in results.results.items():
score1, score2 = result
if score1 > score2:
print(f'{team} won {score1}-{score2}')
elif score1 < score2:
print(f'{team} lost {score1}-{score2}')
else:
print(f'Tie: {team} {score1}-{score2}')
def main(data):
results = load_data(data)
print_results(results)
if __name__ == "__main__":
data = """
Baltimore Orioles at Boston Red Sox
Final score: 4-8
Tampa Bay Rays at New York Yankees
Final score: 0-7
Cleveland Guardians at Detroit Tigers
Final score: 1-2
Toronto Blue Jays at Chicago Cubs
Final score: 3-5
...
Baltimore Orioles at Boston Red Sox
Final score: 14-8
Tampa Bay Rays at New York Yankees
Final score: 0-6
Cleveland Guardians at Detroit Tigers
Final score: 4-1
Toronto Blue Jays at Chicago Cubs
Final score: 5-3
"""
main(data)
This script first loads the data into a GameResult
object, which stores the results of each game. The load_data
function parses each line of the text data and extracts the scores and teams using regular expressions.
The print_results
function prints out the result of each game in a human-readable format.
Finally, the main
function loads the data and prints out the results. Updated: June 26, 2025 at 8:35 PM