Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm on the list of the tutors in my university (for PHP, MySql, CSS, etc) but someone contacted me asking me to teach them entry level Python. Would I be able to be up quickly enough and be able to teach it to someone else?

(I've coded in PHP, Java, C#, Javascript, jQuery, tiny bit of C++ and ASP.NET. I'm a Computer Science student. Just finished my third year.)

share|improve this question

closed as primarily opinion-based by MichaelT, GlenH7, gnat, World Engineer Oct 30 '13 at 21:04

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

In what unit of measurement do you want the answer? I can provisionally tell you that it is a 42 on the open language-learning-hardness scale I just invented. –  Ingo May 12 '11 at 8:35
Have you looked at it? Did you find it difficult? –  LennyProgrammers May 12 '11 at 9:05
If you have to ask the price, you can't afford it. The same goes for learning. If you have to ask, you're already doomed to worrying and wondering. –  S.Lott May 12 '11 at 10:09
Won't this depend on the student and what they want to build with it? Many people have taught Python to themselves. –  JeffO May 12 '11 at 12:03
@S.Lott It's not me I'm worried about. I'm sure I'd be able to teach myself it. My question is about learning it to teach someone else. Soon. @Jeff O just entry level stuff is all I know so probably how do variables, loops, functions work in Python. @Lenny222 it looks very handy to me. But I'm not a beginner. –  Adam Lynch May 12 '11 at 12:12

6 Answers 6

Python is strongly typed like Java and dynamic typed like PHP. It's generally fairly easy to pick up the basics, I'd say an experienced programmer could be up to speed in a couple of hours (and have come across all of the specific oddities of the language within a couple of weeks).

Recommended reading:

Learn Python the Hard Way (exercise based, by Zed Shaw and an excellent way to jump into the language)

Dive into Python (probably the "seminal" book on Python)

share|improve this answer
+1 - though it would help much more to be experienced in another dynamically typed language rather than a statically typed one, and also to be experienced in another garbage-collected language. Some of Pythons relatively distinctive tricks, though, like list comprehensions (copied from Haskell, but not supported by many other languages), are pretty natural. Generators may come as a particular shock, but probably without much trauma. –  Steve314 May 12 '11 at 8:58
Don't forget the actual official tutorial: docs.python.org/tutorial –  ncoghlan May 12 '11 at 10:40
My first exercise in Python (as in very first) was modifying something that used Simple HTTP. I was able to add basic HTTP auth, figure out how to parse an INI style configuration file and grasped nuts and bolts like variable scope within about .. two hours. I wouldn't say Python is easy to learn quickly, but it does very quickly show you how much you have yet to learn. –  Tim Post May 12 '11 at 11:09

Learning the basics can be done pretty quickly, but learning this such as how to write code that is pythonic can take a bit longer.

I'd suggest going through some of the introduction tutorials that Errant suggested, and then trying to work out a lesson plan. Are these students completely new to programming? If so, you'll probably be taking a different approach than if these students are well versed in Java or C.

As a side note, Python also has a lot of built in functionality in its standard library. It may be useful to at least be aware of how you can search it to become more familiar with what it has to offer.

share|improve this answer
As far as I can tell, they would be completely new to programming or beginners at best –  Adam Lynch May 12 '11 at 8:50
If that's the case a lot of what you would be teaching is the basics of programming anyway - which is a fairly language agnostic task. So I don't see you having much difficulty. –  Errant May 12 '11 at 9:12

It's incredibly easy and a great language to learn.

  1. The syntax, especially the use of whitespace, is very clean and makes your code look nice without having to learn or teach "elements of style".
  2. There is an incredibly rational structure to almost every element of the language. Once you learn the basics, you'll find that you can extrapolate very quickly from there without having to flip through language documentation. No operator overloading on "<<", etc.
  3. For when you do actually have to look at the documentation, Python's is very clear.
  4. "Batteries included" + a very healthy library/framework ecosystem (e.g. BeautifulSoup, Django, scipy, etc.) means you can do fun stuff fast.

Yes, writing Pythonic code takes some time, but I'd argue it probably takes less time than to write idiomatic code in a lot of other languages.

share|improve this answer

It's hard when you do it the way Zed Shaw teaches it: http://learnpythonthehardway.org/index :)

But seriously, it is easy to learn. It's basically 'just another imperative langauge', with some differences. When preparing vor teaching, i would emphasise these differences:

  • You should get an understanding how pythons scopes and the method resolution work. In my experience, the tricky questions the students ask are related to these.
  • You can and should teach basics of functional programming, it may not be lisp, but understanding something like reduce(op.add, [1,2,3]) is vital for reading pyhton
  • You cannot teach PPP with it, python has no (real) language features like private/protected/public. That doesn't mean the concepts can be ignored, they just have to be adressed with the design/style issues.
share|improve this answer
and, maybe, when your background is mostly PHP, keep in mind that python is strong typed and everything is supposed to throw an exception if there is a slight doubt. –  keppla May 13 '11 at 14:28

Can you quickly learn enough Python to do something useful? Yes. From a similar background (C, C++, Java, Javascript, VB6), I taught myself enough Python to write my first useful script in about 1-2 days.

Can you quickly learn enough to teach someone? If you're teaching them a general computer-science/programming subject where Python merely happens to be the medium, then maybe. But if you're teaching Python itself, then no. Python is different enough from all the languages you've mentioned that you wouldn't be able to do justice to it. For me, it took about 1-2 years before I considered myself an intermediate-to-advanced programmer.

Even now, 4 years since I first picked it up, I don't think I could teach an exhaustive course on Python without substantial preparation. For example, I've never built my own multiple inheritance hierarchy in Python, so I don't quite know what the method resolution order is (I know roughly how things are resolved, but not having ever needed to do it, I would need to experiment to be comfortable enough to teach it). If I had to teach, for the first time, a course on Python, I would need at least a month's preparation, perhaps even more.

Of course, this doesn't mean you can't help someone with their Python, just that you shouldn't aim to be their only instructor in the language, since it would be profoundly unfair to both the student and yourself.

share|improve this answer

For complete programming novices, I'm still inclined to recommend "How To Think Like A Computer Scientist". As a tutor already familiar with other languages, you could definitely skim it yourself and use the material to coach the interested students.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.