python snippets corrected