python working code