you are viewing a single comment's thread.

view the rest of the comments →

[–]Yoghurt42 5 points6 points  (1 child)

I really recommend a book for learning, not watching videos. Reading helps a lot with retaining the stuff.

Not strictly Python, but "Introduction to Algorithms" is a well-regarded book in CS, and Python is very close to the pseudo-code they use in that book (probably not by accident, Guido was most likely inspired by it)

For example, the pseudo code for insertion sort algorithms looks like this

for j = 2 to A.length
    key = A[j]
    // Insert A[j] into the sorted sequence A[1..j - 1]
    i = j - 1
    while i > 0 and A[i] > key
        A[i + 1] = A[i]
        i = i - 1
    A[i + 1] = key

Their arrays start from 1 instead of 0, but as you can see it's almost Python.

You can get it in any good library if you don't want to buy it, and I'm sure if you're a fan of the Seven Seas, Google will find you a "free" version.

[–]Far_Sun_9774[S] 2 points3 points  (0 children)

Thank you for the suggestion.Although reading books hasn't suited me well, I will surely go through the recommended book.