Cat bites me when I stop petting her!

Mr

I have two cats. With my oldest cat if I stop petting her she’ll nudge at me to continue. With my younger cat if I stop petting her and I stop paying attention she’ll nip at me! It’s like a quick pinch, not hard enough to draw blood but enough to catch me off guard. Anyway to curb this? I know she’s just asking for more petting but ouch!!!