Skip to content

binarybull-404/star_pattern_versatile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Star Pattern Generator (Python)

A command-line Python program that generates a symmetrical hollow diamond-style pattern using a user-defined symbol and an odd-sized width.

The program validates user input, enforces odd-number constraints, and dynamically builds the pattern using loops and spacing logic.


Features

  • Generates a symmetrical star/symbol pattern
  • Enforces odd-number input only for correct symmetry
  • Allows the user to choose any symbol for the pattern
  • Input validation for:
    • Non-numeric values
    • Even numbers
  • Clean top, middle, and bottom pattern structure

How the Pattern Works

  • The pattern width is defined by an odd number n
  • The pattern consists of:
    • A full top line
    • An expanding upper half
    • A contracting lower half
    • A full bottom line
  • Spaces are calculated dynamically to maintain symmetry

Example Pattern

Input

  • Number of pattern: 5
  • Symbol: *

Output

*****
** **
*   *
** **
*****

Concepts Used

  • Functions
  • Input validation
  • While loops
  • For loops
  • String multiplication
  • Pattern symmetry logic

How to Run

python star_pattern_versatile.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages