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.1.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.1-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: simple_star_patterns-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 23f44aede7bcc65c4e587a6997bcdd00df14572957b7087318dc67a089b0eb78
MD5 fab9fc1eb5535110e9807df1bb4ca568
BLAKE2b-256 4ef54aef69444ac2985dabbe9a4d817ad6591aeb253751fc7b1a67ad82f52e77

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for simple_star_patterns-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f439c423171a33fbcacf84c8cf0e48f68ae0d4371ce5ada0951b900240e5f10a
MD5 6aa4fca1cf7f007701200ff43a5d60e7
BLAKE2b-256 572f9abc766de260ba47bb197285275c29a55846eb42c6cf8bdee9a1d6b61d9c

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