It takes a couple of hours to learn enough to write basic code. But, generally, you need to work for at least three months to get confidence in Python fundamentals. Developing more and more speeds up your learning process.