# How to learn python algorithm

I’m trying to learn Python by following the MIT online tutorial. I have some prior programming experience, but have never taken any advanced course at school. I am having great difficulty in learning the python algorithm, for example the random walk problem (17: Computational Models: Random Walk Simulation | Introduction to Computer Science and Programming | Electrical Engineering and Computer Science | MIT OpenCourseWare)

I wonder how other people learnt python algorithm. I am wondering if I’m using the right learning approach or maybe my IQ is not enough to learn python…

I’m trying to learn Python by following the MIT online tutorial. I have
some prior programming experience, but have never taken any advanced
course at school. I am having great difficulty in learning the python
algorithm, for example the random walk problem
(17: Computational Models: Random Walk Simulation | Introduction to Computer Science and Programming | Electrical Engineering and Computer Science | MIT OpenCourseWare)

I’ve had a glance at that lecture (well, the transcripts). It looks like
they’re simulating a random walk. There isn’t really an “algorithm” for
this except in the most basic sense: traverse whatever you’ve got,
making random choices.

I wonder how other people learnt python algorithm. I am wondering if
I’m using the right learning approach or maybe my IQ is not enough to
learn python…

It is very unlikely that you can’t learn algorithms. Perhaps you just
haven’t found a useful learning path. On a personal basis, I almost
never watch video tutorials unless it’s for something very visual.

An algorithm’s just a reliable way of getting an outcome. There are
various formalised algorithms for common problems such as sorting or
seaching, where someone has devised a method which is known to be the
most efficient, or has some other desireable property for the situation.

Cheers,
Cameron Simpson cs@cskk.id.au

From looking at the handout from another post, I can see that it’s from 2008 and is using Python 2, so the code needs to be tweaked a bit for Python 3.

I know. It’s a newer version of the MIT course, but it covers fewer topics than this one. What I really want to learn are basic concepts like recursion, inheritance, so I guess python 2 does not matter.

I want to take MIT master course on machine learning in python, this undergraduate course is a preparatory course.

There are many very useful and free to download PDF books that cover all manor of Python related topics.

Here is just one site that I think is of huge value

Invent with Python is another very good resource.

Thanks, Rob. The first link is blocked by Google due to security issue.

The second link, the book on recursion looks quite relevant to me.

You are welcome. I can’t even think why Google would have an issue with that site; it not unsafe and has a huge amount of very useful stuff; shame.

Still, you have a very good link in Invent.

Try this also: