Skip to main content

A simple library for printing star patterns

Project description

Simple Star Patterns

Simple Star Patterns is a Python library for printing various star (or any character) patterns. It's designed to be easy to use and understand, making it perfect for beginners learning about loops and pattern printing in Python.

Installation

You can install the Simple Star Patterns library using pip:

pip install simple-star-patterns

Usage

Here's a quick example of how to use the Simple Star Patterns library:

from simple_star_patterns import print_pattern

# Print a triangle
print_pattern('triangle', 4)

# Print an inverted triangle with '+' symbol
print_pattern('inverted_triangle', 5, '+')

# Print a pyramid with '#' symbol
print_pattern('pyramid', 3, '#')

This will output:

*
**
***
****

+++++
++++
+++
++
+

  #
 ###
#####

Available Patterns

  1. triangle: A right-angled triangle
  2. inverted_triangle: An inverted right-angled triangle
  3. pyramid: A symmetrical pyramid

Function Parameters

  • pattern: The type of pattern to print ('triangle', 'inverted_triangle', or 'pyramid')
  • size: The number of rows in the pattern (must be a positive integer)
  • symbol: The character to use for the pattern (default is '*')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simple_star_patterns-0.2.3.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simple_star_patterns-0.2.3-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file simple_star_patterns-0.2.3.tar.gz.

File metadata

  • Download URL: simple_star_patterns-0.2.3.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.6

File hashes

Hashes for simple_star_patterns-0.2.3.tar.gz
Algorithm Hash digest
SHA256 cfa75cfd74b8dc1be0b2707a305960064ae3a55a46904c5090202186722fa9cc
MD5 e7a45bb503ff13fd13edfa6affcd0786
BLAKE2b-256 fbf8c19e0803f8e7f22bb96c853453c55b8edf7d28509e15627c4fad2d3f5d10

See more details on using hashes here.

File details

Details for the file simple_star_patterns-0.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for simple_star_patterns-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 872929f6a12a210f7ccb3b50f0e31105166194d2ac8ef946fe370ffeb13ca326
MD5 2ff2f74cd9b24608e512495b383eaddf
BLAKE2b-256 3cfab5883d4a9493bd2ac2913cd90bf90671e6f879b1d80eefdee8c554e5826c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page