Mates I am trying to solve the assignment 1
The dataset file in assets/grades.txt contains a line separated list of people with their grade in a class. Create a regex to generate a list of just those students who received a B in the course.?
with open ("assets/grades.txt", "r") as file:
grades = file.read()
# YOUR CODE HERE
for item in re.finditer("(?P<name>.*)(\: B)",grades):
assert len(grades()) == 16
I suppose to get 16 PEOPLE WHO GOT B in their course but it shows only 1 guy in the out put i dont understand wts wrong with my codes… Mates help plz