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.2.tar.gz (2.3 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.2-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: simple_star_patterns-0.2.2.tar.gz
  • Upload date:
  • Size: 2.3 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.2.tar.gz
Algorithm Hash digest
SHA256 bcb37fb8db937da5b85de3cb8dafadbf8794739a83237d3a76642bf22a50fffc
MD5 22f90a8d0c844de884d0973e9eae85fe
BLAKE2b-256 e8fb138bb89cf6a9b50d9c3c655973fffaed8532d6713ec45849acf388106ff2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for simple_star_patterns-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 978b557b4b3d7f0625929ae842dc6a94ede473f7bfce0b5e7195bd042b66f388
MD5 eee16022c4a003eda95c868a3a614b5b
BLAKE2b-256 1e9be44920c7fa9d6d599e5e24dd3b73e146c7a157b35bc87dd490a8a60a4451

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