Updating python snippet