Learning Python π is not just a prerequisite for getting into machine learning, but it's an investment that will help your career for the rest of your life.
A thread with my recommendations:
β 1/10
Before getting into it, if you have never coded before, make sure you build your Python skills to a point where you feel really comfortable solving problems.
Take your time, and don't rush it.
β 2/10
A lot of people want to read a book and immediately jump into machine learning.
Everything is possible in life, but I'd recommend you focus on building a strong coding foundation before moving on.
β 3/10
A good course you can use to start is "Introduction to Python Programming."
Here you'll learn Python's fundamentals, along with programming best practices, libraries, and everything you need to become a developer.
There are a couple of libraries that you want to pay special attention to:
β’ NumPy
β’ Pandas
These two are fundamental for machine learning. Try to go through a few tutorials and learn how to use them early on.
β 7/10
My favorite source of Python information is @realpython's website.
You can learn all things Python from the ground up. Everything from the language's absolute basics to web development and web scraping to data visualization and beyond.
If you are looking for more, this course from Harvard University is an excellent introduction to probability as a language and a set of tools for understanding statistics, science, risk, and randomness.