Question: Python 3.7.2 for language Please comment for each line of code good naming is important 1. Answer the question: what is the Python regular expression

Python 3.7.2 for language

Please comment for each line of code

good naming is important

1. Answer the question: what is the Python regular expression pattern that would match a hex color (https://en.wikipedia.org/wiki/Web_colors ) (for example, the pattern that would match an email address is '[\w.-]+@[\w.-]')

  1. Write an algorithm for step 3. As part of your algorithm, be sure to describe the pattern you're using to find the win/loss result for each game.

  1. Write a program that looks at the source of http://cgi.soic.indiana.edu/~dpierz/mbball.html (http://cgi.soic.indiana.edu/~dpierz/mbball.html ) (a copy of the IU men's basketball team record page). Use regular expressions to find all the games IU has played in this year and calculate the total number of wins and losses (including exhibition games)

The output should look like the following:

Wins: 18 Losses: 12

Bonus [10 pts]. Extend your code from part 3 to also calculate the total difference in points scored in all the games (a game that finished 68-71 would have a difference of 3 points, 85-52 a difference of 33 points etc)

Total Difference: 431

Remember, as always good coding practices are part of the grade so be sure to comment your code, use good variable names, efficient regular expressions, etc.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!