That's true but also ignores the problem that many people drop out of tech due to discrimination or feeling like they don't belong even though they are interested.
"While a majority of the men in the study reported that their internship experiences were positive, women’s experiences were much more of a mixed bag, full of ageism, sexism, and not being taken seriously"
https://www.womenintech.com/mit-study-figures-out-why-so-man...