Skip to content

Simple high school project with turtle, turtle is a pre-installed Python library that enables users to create pictures and shapes by providing them with a virtual canvas. The onscreen pen that you use for drawing is called the turtle and this is what gives the library its name.

License

Notifications You must be signed in to change notification settings

gladw-in/high-school-python-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Turtle Graphics Patterns

This Python script uses the turtle module to create various colorful graphics and patterns. You can generate multicolor stars, squares, hexagons, a sun-like spiral pattern, and even the Sindhi High School logo. The script provides an interactive menu to let users choose which pattern they want to draw and customize the colors used.

Features:

  • Multicolor Stars: Create a star pattern with multiple colors.
  • Multicolor Squares: Draw a series of squares, each in different colors.
  • Multicolor Hexagons: Generate a series of hexagons with varying colors.
  • Sun Pattern: Create a sun-like spiral pattern with a specified color.
  • Sindhi High School Logo: Draw the Sindhi High School logo with customizable main and accent colors.

Screenshots

Multicolor Stars

Multicolor Squares

Multicolor Hexagons

Sun Pattern

Sindhi High School Logo

Requirements:

  • Python 3.x
  • turtle module (comes pre-installed with Python)

How to Run:

  1. Clone the Repository

    git clone https://github.com/gladw-in/high-school-python-project.git 
    cd high-school-python-project
  2. Run the Script python main.py

  3. Follow the On-Screen Instructions The script will present a menu with options to choose different patterns. You can input the colors and other parameters as requested.

Functions:

  • set_turtle_attributes(turtle_obj, color, speed, width) Sets the attributes of a turtle object including its color, speed, and width.

  • blank(val) Fills the background with a single color.

  • multi_star(colors, layers) Draws a multicolor star pattern. You need to specify the list of colors and the number of stars per color.

  • multi_sqr(colors, num_squares) Draws a series of multicolor squares. You need to specify the list of colors and the number of squares.

  • multi_hexa(colors, num_hexagons) Draws multicolor hexagons. You need to specify the list of colors and the number of hexagons.

  • sun(color) Draws a sun-like spiral pattern with the specified color.

  • schlogo(main_color, accent_color) Draws the Sindhi High School logo with specified main and accent colors.

  • get_colors() Prompts the user to input a list of colors. The number of colors must be between 1 and 20.

  • main() The main function to interact with the user and call appropriate drawing functions based on user input.

License:

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing:

Feel free to open issues and submit pull requests for improvements or bug fixes.

Acknowledgments:

  • The turtle module is a great tool for introducing programming to beginners and creating simple graphics.

About

Simple high school project with turtle, turtle is a pre-installed Python library that enables users to create pictures and shapes by providing them with a virtual canvas. The onscreen pen that you use for drawing is called the turtle and this is what gives the library its name.

Topics

Resources

License

Stars

Watchers

Forks

Languages