Code For Patterns In Python