Code For Pattern In Python