News for hackers. Stuff that matters.
Re:Ask HN: Simple exercises for a python beginner? by JeanPierre on Sunday May 16, 2010 @07:58PM (#1353089)
I think Codingbat is a good place to begin/start with python, and it's also good for exercises. As they have an online interpreter, you get a definitive yes/no answer, with elaboration where things go wrong. http://codingbat.com/python
Re:Ask HN: Simple exercises for a python beginner? by anthonyb on Sunday May 16, 2010 @09:17PM (#1353205)
Their interpreter seems to be broken. eg. for http://codingbat.com/prob/p126968 the following solution seems ok:

    def centered_average(nums):
        sum(nums[1:-1]) // (len(nums) - 2)
but gives me an error: 'sum is not defined'.

Also, all of their examples use two spaces, not four (the python standard)