Learning Python sample code