Python training code