I just want to add here that you shouldn’t rely on asking for extra credit and receiving it. Sure, this professor went ahead and did it, but I know other instructors (including myself) who would be annoyed and would ask why you weren’t so concerned with your grade/extra credit during the beginning of the course. I had a student do something similar and it really frustrated me because the student didn’t put in the hard work required to get the grade they requested and it felt like they were disrespecting me by asking to get a grade they didn’t earn. (not saying you were disrespectful or didn’t work hard – just saying instructors may have negative experiences with students doing this).
I’m glad it worked out for you, but try not to do this very often because every instructor is different and it may not bode so well in the future. Work hard to get a good grade and know that sometimes you fall short and that can be okay.