DEV Community

Cover image for What are the most important topics to learn in Python?
narendra8989
narendra8989

Posted on

What are the most important topics to learn in Python?

Get a good development environment. Shell+Emacs, or Shell+VIM are OK-ish, but not very supportive for beginners. IDLE is not much better. I have not tried VSCode+Python plugin. Nor have I tried VisualStudio+Python plugin. PyCharm is excellent, I can recommend it to all.

The try writing some small programs using the environment, do “Hello World”, do “Fizz Buzz”, do “Factorial” and “Fibonacci”, do “Mean, Median, Mode, Standard Deviation”. They are small programs to get you into the swing of writing and executing Python programs. See if you can find an expert Python programmer to give feedback on your code. Feedback on what is right and wrong about the code you write is the most important thing to help you learn.

Then you need to find some harder programs to write. Find a problem from a field that interests you. The crucial thing is to decide what the data structures should be for solving the problem. Carefully organised data should lead to relatively straightforward algorithms and hence code. Python has list, tuple, set, dict (aka map), files (don’t forget RAII, with statement, using files) built in, but these are just the base tools, it is how you use and combine their use to create data structures for solving your problem that is crucial. You will find that most courses and webpages just introduce the base types, they do not really cover how to use complex combinations to represent the data of the problem. If ever you find yourself writing exceedingly intricate code, this is an indication that the data structure may be wrong.

The Python library contains a huge amount of really good stuff, along with a few bits of cruft that should be removed but is unlikely to be. Having a look at what modules there are in the library and looking at what they can do is always a good thing. The modules sys, os, and pathlib are ones everyone uses. Then there is itertools and functools lots of good stuff there. subprocess may become useful, or it may not. These are just a few, it is worth taking a look at the module index from time to time. During code development, always ask the question: is the feature I need for my code something already in the library? Always prefer library code to writing the same thing yourself.

So getting an environment working, writing some code to learn some Python syntax, learn the Python library, and learn Python data structures. Then the crucial skill is being able to create problem specific data structures and algorithms using the base tools.

PS There is also PyPI which has a mass of contributed modules and packages. Many of these are total rubbish, but there is a lot of good stuff in there. If you get into data analysis you will likely want numpy, pandas, scikit.learn, matplotlib. But there is a whole lot more. Always look for good quality pre-written, generally approved stuff before writing your own, it saves a lot of effort. Build on the shoulders of giants leads to quicker development of smaller more functional programs.

Meet the Experts for Better Guidence : https://nareshit.com/python-online-training/

Top comments (0)