Apologies, I’m swerving off topic!
So, I thoroughly recommend Python. I’m working through this course on edX https://courses.edx.org/courses/course-v1:MITx+6.00.1x_11+1T2017/info it could be a touch difficult for a beginner but what it is very good at is teaching founding principles.
This guy on You Tube takes you from the beginning right up into Machine Learning etc using Python. https://www.youtube.com/channel/UCfzlCWGWYyIQ0aLC5w48gBQ
What were my mistakes when learning to code? Honestly, I would say that a big mistake is trying to learn too much and spreading myself/yourself too thin. There are so many frameworks and languages now. Better to pick something and learning it well than trying to know a little of everything. Well that’s my opinion anyway.
Hope that ramble helps in some way.