Question: Code v v Validate Open in . . . Python 3 ( ipykernel ) The dataset file in assets / grades . txt contains multiple

Code vv Validate
Open in...
Python 3(ipykernel)
The dataset file in assets/grades.txt contains multiple lines of people along with their grades in a class. Fix the incorrect regex between ### FIX CODE BELOW and ### FIX CODE ABOVE to generate a list of just those students who received a B in the course (e.g.,['John Doe', 'Jane Doe'].)
[22]: def student_grades():
import re
with open ("assets/grades.txt","r") as file:
grades = file. read()
### FIX CODE BELOW
pattern =r'??w+??s??w+??sB'
matches = re.findall (pattern, grades)
### FIX CODE ABOVE
# YOUR CODE HERE
return matches
[20]: assert len(student_grades ()
 Code vv Validate Open in... Python 3(ipykernel) The dataset file in

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!