Exploring Number, Square, and Cube Patterns in Python