Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to become a good Python coder? [closed]

Tags:

python

I started with c++ but as we all know, c++ is a monster. I still have to take it and I do like C++ (it takes programming a step further)

However, currently I have been working with python for a while. I see how you guys can turn some long algorithm into simple one.

I know programming is a progress, and can take up to years of experience. I also know myself - I am not a natural programmer, and software engineering is not my first choice anyway. However, I would like to do heavy programming on my own, and create projects.

How can I become a better python programmer?

like image 655
CppLearner Avatar asked Dec 15 '09 15:12

CppLearner


People also ask

How long does it take to get good at coding Python?

In general, it takes around two to six months to learn the fundamentals of Python. But you can learn enough to write your first short program in a matter of minutes. Developing mastery of Python's vast array of libraries can take months or years.

How many hours should I practice Python?

How Many Hours Does it Take to Learn Python? If you're a beginner and you want to learn Python in two months or less, you would need to devote a full-time schedule to learning Python. If you spend 40 hours a week learning Python, it could ultimately take around 250 hours to fully develop your Python skills.

Can I master Python in 4 months?

If you just want to learn the Python basics, it may only take a few weeks. However, if you're pursuing a data science career from the beginning, you can expect it to take four to twelve months to learn enough advanced Python to be job-ready.


5 Answers

  • Write code
  • Read books, http://www.coderholic.com/free-python-programming-books/
  • Read code
  • Read tutorials, http://www.dabeaz.com/talks.html, ...

  • Write more code

  • Do exercises, e.g. Building Skills in Python
  • Write even more code
  • Answer SO python questions, https://stackoverflow.com/unanswered/tagged/python
  • Check (your) code regularly, http://pypi.python.org/pypi/pylint

  • Watch talks and presentations:

    • Easy AI in python,
    • Advanced python or understanding Python,
    • http://pycon.blip.tv/, ...
like image 184
miku Avatar answered Oct 23 '22 13:10

miku


Read code. This will help you learn what works well in Python and what doesn't. As part of this, learn python idioms and the standard library.

Some examples of literature to read:

  • http://ivory.idyll.org/articles/advanced-swc/
  • http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html
  • http://www.dabeaz.com/generators/

As for the algorithm part you mention, some specific parts of the standard library to learn include:

  • itertools
  • functools
  • contextlib
like image 30
Ed. Avatar answered Oct 23 '22 12:10

Ed.


One suggestion is to find an open-source project in Python, and start contributing. You may ask "how can I contribute, if I'm a beginner?". One answer is "write tests". Almost any project will welcome you as a tester. Another answer is "documentation", though that is less likely to give immediate benefits.

like image 33
Michael Easter Avatar answered Oct 23 '22 14:10

Michael Easter


The already-posted answers are great.

In addition, whenever you're coding something in Python and you start doing something that feels clumsy, take a step back and think. If you can't think of a more elegant way to do it, post it as a question on Stack Overflow. I can't count the number of times that I've seen someone reduce ten lines of Python into one (which is still perfectly easy to read and understand).

like image 43
jakeboxer Avatar answered Oct 23 '22 13:10

jakeboxer


in addition to suggestions pointed by "The MYYN" I would suggest use of pylint

like image 42
DrFalk3n Avatar answered Oct 23 '22 12:10

DrFalk3n