What does "to one's credit" mean? Can you give me some examples?

Native speaker’s answer
Rebecca
The expression "to one's credit" is used to acknowledge that one deserves recognition or credit for something (a positive thing). In this case, the speaker is stating that although she was surprised and confused by the French doctor's actions, she didn't know what was going on, so she couldn't properly judge the situation. It might have just been a cultural difference, or that medical practice in France is different than what she was used to in America. Ex: To his credit, the Ukrainian president has done a great job of uniting his citizens during this war. Ex: She didn't perform well this time. But to her credit, she has done amazingly all other times.