My roommate has a cat. He is a one mouth old kitty. He's cute but it always bite my legs when I am walking. He holds my legs and bites. Is that all cat would do that? I don't want to get hurt.
The kitty is just a small baby, and only wants attention and playtime. I understand you very well, they can have a lot of energy and playfulness, and their bites hurt. Also have in mind that she is not yet able to properly control the bite force.
I guess that the kitty actually considers you friend / family so, in a way, you should be honored. Your pain does not enjoy the honor, understandably, but nevertheless.
It might work if you dedicate some time to actually playing with the cat. Once the play needs are diminished, biting might stop.
On the other hand, it might work against you as well, since the cat will understand that you are as playful as she is. So you will have to play often - which is not necessarily bad, if you have the time.
As a specific training, you might want to interact with the cat and show your pain (even exaggerated, if needed), so she will understand how to bite without hurting.