I am working on a regex problem from coursera and it has provided a data file of names followed by ": grade". We have to find and return the names of all the students who have a B. What I did was use this regex code
Bstudents = re.findall("(/w )*: B", grades) #grades is the name of the variable with the names+grades.
There are supposed to be 16 students who have the grade B, but Instead of their names I am getting 16 blank strings.
here is the list:
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
"(/w ).*: B"/wmatches literally a slash and a double-u…