PYnative

Python Programming

  • Learn Python
    • Python Tutorials
    • Python Basics
    • Python Interview Q&As
  • Exercises
    • Python Exercises
    • C Programming Exercises
    • C++ Exercises
  • Quizzes
  • Code Editor
    • Online Python Code Editor
    • Online C Compiler
    • Online C++ Compiler
Home » Python » Python Programs to Print Patterns – Print Number, Pyramid, Star, Triangle, Diamond, and Alphabets Patterns

Python Programs to Print Patterns – Print Number, Pyramid, Star, Triangle, Diamond, and Alphabets Patterns

Updated on: September 3, 2024 | 457 Comments

This Python lesson includes over 35+ coding programs for printing Numbers, Pyramids, Stars, triangles, Diamonds, and alphabet patterns, ensuring you gain hands-on experience and confidence in your Python skills.

Printing numbers, stars (asterisk), or other characters in different shapes (patterns) is a frequently asked interview question for freshers. Creating these number and pyramid patterns allows you to test your logical ability and coding skills.

In this lesson, you’ll learn how to print patterns using the for loop, while loop, and the range() function.

This article teaches you how to print the following patterns in Python.

  • Number pattern
  • Pyramid pattern
  • Inverted pyramid pattern
  • Half pyramid pattern
  • Triangle pattern
  • Star (*) or asterisk pattern
  • Diamond Shaped pattern
  • Characters or alphabet pattern
  • Square pattern