Lec4 writing closure python