how to get this output let's see A classic pyramid structure where spaces are calculated dynamically to keep the asterisk sperfectly centered.
Eachsubsequent row increases by two stars (1,
3, 5, 7…).To create these layouts in Python,
the code typically uses multi-loop structures where:
The Outer Loop controls the current row number(moving from top to bottom).
The First Inner Loop prints the required number of leading blank spaces to push the stars into alignment.
The Second Inner Loop prints the exact number of asterisks (*) needed for that specific row before moving to a new line.
Once executed, the terminal renders a series of distinct geometric star shapes.
Based on the video,the program prints the following patterns sequentiallyShape ARight-Angled Triangle (Left-Aligned)A simple pattern where the number of stars
increases by one with each row.
User Input: At the start of the execution,
the program prompts the user for an input.
The user types 4, hits enter, types 8, and hits enter
💻 Perfect for beginners learning:
pyramid 🔺 patterns
python code
Structure code
✨ Keep learning, keep building!
📌 Don’t forget to:
👍 Like | 💬 Comment | 🔔 Subscribe
🚀 More coding videos coming soon on Vijay Tech Life.
#coding #programming #python
#Shorts #VijayTechLife