This question has options. Does the word "beg" have the same definition in the next two sentences?

I beg your pardon. I didn't mean to cause offence.

He begged her to go to the prom with him.

Choose from: A). different meanings. B). the same meaning.
B).