Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 ()
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Automating Access Databases With Macros

Authors: Fish Davis

1st Edition

1797816349, 978-1797816340

More Books

Students also viewed these Databases questions