the sorting one should be fairly simple, here's one of my personal favorites.
Code:
def quicksort(left,right,valarray):
a= left
b = right-1
while a != b:
if valarray[a] <=valarray[a+1]:
temp = valarray[a]
valarray[a] = valarray[a+1]
valarray[a+1] = temp
a= a+1
else:
temp = valarray[a+1]
valarray[a+1] =valarray[b]
valarray[b] = temp
b = b-1
print valarray
if a+1<right-1:
quicksort(a+1,right,valarray)
if a > left+1:
quicksort(left,a,valarray)
this basically takes the first element, places all elements smaller than it on the right, all elements greater than it on the left, and the recursively sorts the left and right
well that's basically the guts of programming. there's still a lot to learn of course, such as object oriented programming, but this is beyond the scope of a beginner tutorial. if you would like to hone your skills, the website topcoder.com has hundreds of practice problems ranging from easy to advanced. if you need more help, there's plenty of stuff online for more information.