Look up some tutorial sites.
Do the tutorials there. I mean do them, write the code, not just read what they have to say, but type it out yourself. See how the code runs. Change a thing here and there. Experiment.
When you're done with the tutorials and you know the basics, start with small projects (e.g. print the first n number of primes). Try to do them on your own. If you get stuck, search the Web for help.
Use online reference manuals that show you how to use functions.
Keep practicing and increasing the complexity of your projects.
Here's a good start:
https://www.w3schools.com/python/