Python Tutorial

Python Home

Python Methods

Python String Methods

Python Interview Programs

Python Common ProgramsPython Array ProgramsPython Converter ProgramsPython Star Patterns ProgramPython Number Patterns ProgramPython Alphabet Patterns Program

Python Reference

ASCII Table

Python Number Pattern 41

Last Updated:

Python Number Pattern 41

Try to print the following number pattern using Python.

Print This Output
                  1
              4   9  16
         25  36  49  64  81
    100 121 144 169 196 225 256
289 324 361 400 441 484 529 576 625

Source Code

Python Compiler
m = 0 for i in range(2, 11, 2): for j in range(i, 10): print(" ", end=" ") for k in range(1, i): m += 1 print("%3s" % (m*m), end=" ") print()

Share this Page

Meet the Author