I myself ended up trying to code PHP a couple more times. I didn't even think I knew the hang of HTML for years (I know there's not much to get). Until I did finally get the hang of basic coding then intermediate coding and so on, I never considered myself a failed coder before I got the hang of it.
I had my own reasons for "failing" at my high school coding (technically I got As but I knew nothing), just dividing things up by how genders might function or learn wouldn't have helped me. For example I personally had massive anxiety and confidence issues.
Not to dismiss issues with females not being in programming enough. We definitely need to get more women into STEM and programming.