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.
- 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.
- Python 3.x
turtle
module (comes pre-installed with Python)
-
Clone the Repository
git clone https://github.com/gladw-in/high-school-python-project.git
cd high-school-python-project
-
Run the Script python
main.py
-
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.
-
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.
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to open issues and submit pull requests for improvements or bug fixes.
- The
turtle
module is a great tool for introducing programming to beginners and creating simple graphics.