So, so, so many people have learnt to code on their own without a mentor. It requires a strong desire to learn and perseverance but it’s absolutely possible.
That you can learn so much about programming from books and open source and trial and error has made it a refuge for people with extreme social anxiety, for whom "bothering" a mentor with their questions would be unthinkable.