As no one else has said this so far, I will;
Do NOT, repeat NOT, buy a gun.
Given what you said about your inexperience with firearms, you will NOT be able to pull it out, aim and fire to disable or kill without hesitation. That hesitation, which is entirely normal, will mean that the attacker takes the gun away and uses it on you. This has happened to untrained people I know. Men as well as women.
Unless you are willing and able to take a training course that will eliminate that fatal, humanitarian hesitation, buying and carrying a gun is a very, very BAD idea.
The best defense sprays combine pepper and mace. Because you know they are non-lethal, that hesitation will probably not be a factor.
Regarding martial arts; if you can find a school that teached Tae Kwan Do, that is the one I reccomend for most women. The human adult female usuallyt had far more power in her legs and hips than she does in her upper body, and Tae Kwan Do, especially the Moo Duk Kwan variant, makes very good use of that strong point of womens physical makeup.
Most guys who make a habit of attacking women know to guard their crotch; Tae Kwan Do will teach you how to shatter his kneecap, much harder for him to block or avoid, especially if you aim for the leg his weight is resting on.
Then, you run for your car, get in, start the motor, and RUN THE ASSHOLE OVER! Tell the cops that in the dim light you thought he was pulling a gun and were in fear for your life. They won't even prosecute.
