
python - Turtle graphics, draw a filled star? - Stack Overflow
Dec 21, 2023 · To get a 5 pointed star, you should draw 2 lines for each side. The angles need to add to 72 (360/5) import turtle def draw_star(size, color): angle = 120 turtle.fillcolor(color) …
function - Making a star in python turtle - Stack Overflow
Nov 15, 2015 · I've been trying to make a star in python, but all i keep getting is some zig zag lines. My code is: import turtle star = turtle.Turtle() wn = turtle.Screen() wn.setup(800, 600) …
Python draw n-pointed star with turtle graphics - Stack Overflow
This code will draw a star with any number of points greater than 5. It takes two arguments: n is the number of vertices and size controls the size of the turtle's steps.
graphics - Using turtle in Python to draw six-pointed stars with ...
Oct 24, 2016 · Hopefully I'll be able to explain this well. I'm currently using helper functions to draw a six-pointed star in the turtle graphics window of python. First, we had to create a …
Drawing Stars with turtle in python - Stack Overflow
These are all valid points (as I'm sure you know by your SO score). But running the the program (by copying the source into IDEL), the code draws a star (albeit without asking). Turtle seems …
Drawing a star on Python using "drawStar" - Stack Overflow
import turtle def drawStar(n, l): """Get turtle to draw a star with n sides of l length""" for _ in range(n): turtle.forward(l) turtle.left(2 * 360 / n) # calculate the angle drawStar(7, 100) …
python - How to make a six sided star using turtle, with different ...
Aug 29, 2020 · An alternative approach, that still puts the turtle at the center of the figure, is to push the centering work into triangle() and keeping sixPtdStar() simple. One way to do this is …
python - How to draw a star using Turtle - Stack Overflow
Jan 29, 2020 · Let's say a function named draw_star takes 2 parameters: size and points, as: def draw_star(size,points): And if I were to call the function using draw_star(100, 9) the output …
python - Filling a star shape with Turtle - Stack Overflow
Apr 19, 2023 · I'm new to Python and I'm learning graphics using turtle. I'm attempting to color a star I've drawn, but the color won't fill for every part of the star. Here is my code: def red_star(): …
python - Using turtle graphics to draw an n-pointed star - Stack …
Jun 20, 2021 · What I mean by star is a geometric figure whose lines crisscross; that starts from a point and returns to the starting point, and at no point does the pen drawing the figure lifts up …