Code generated while learning python