Question: How to fix the incorrect regex between `### BEGIN CODE` and `### END CODE` to generate a list of just those students who received a

How to fix the incorrect regex between `### BEGIN CODE` and `### END CODE` to generate a list of just those students who received a B in the course (e.g., \[\'John Doe\', \'Jane Doe\'\].)

import re

def student_grades(): with open ("assets/grades.txt", "r") as file: grades = file.read()

### BEGIN CODE pattern = """(\w+)""" matches = re.findall(pattern,grades) ### END CODE # YOUR CODE HERE raise NotImplementedError()

return matches student_grades()

assert len(student_grades()) == 16

How to fix the incorrect regex between `### BEGIN CODE` and `###

***FROM GRADES TXT FILE

END CODE` to generate a list of just those students who received

Show Hint In [ ]: import re def student_grades(): with open ("assets/grades.txt", "r") as file: grades = file.read() ### BEGIN CODE pattern = """(\W+)". matches = re.findall(pattern, grades) ### END CODE # YOUR CODE HERE raise NotImplementedError() return matches student_grades() In [ ]: assert len(student_grades() == 16 Ronald Mayr: A Bell Kassulke: B Jacqueline Rupp: A Alexander Zeller: C Valentina Denk: C Simon Loidl: B Elias Jovanovic: B Stefanie Weninger: A Fabian Peer: C Hakim Botros: B Emilie Lorentsen: B Herman Karlsen: C Nathalie Delacruz: C Casey Hartman: C Lily Walker : A Gerard Wang: C Tony Mcdowell: C Jake Wood: B Fatemeh Akhtar: B Kim Weston: B Nicholas Beatty: A Kirsten Williams: C Vaishali Surana: C Coby Mccormack: C Yasmin Dar: B Romy Donnelly: A Viswamitra Upandhye: B Kendrick Hilpert: A Killian Kaufman: B Elwood Page: B Mukti Patel: A Emily Lesch: C Elodie Booker: B Jedd Kim: A Annabel Davies: A Adnan Chen: B Jonathan Berg: C Hank Spinka: B Agnes Schneider: C Kimberly Green: A Lola-Rose Coates: C Rose Christiansen: C Shirley Hintz: C Hannah Bayer: B

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!