I changed the number of degree and distance and we

try on the define function.

fun and happy. at the begining of the coding, i felt nervous, and now i know the basic process of doing this assignment.
This commit is contained in:
蔡卓耘 2024-09-17 13:25:22 -04:00
parent d5f6c521f1
commit 01ed095b84
1 changed files with 7 additions and 10 deletions

View File

@ -7,16 +7,13 @@ from turtle import (
pendown,
color,
)
def star(distance, degrees):
for side in range(5):
forward(distance)
right(degrees)
forward(100)
right(360 * 2 / 5)
forward(100)
right(360 * 2 / 5)
forward(100)
right(360 * 2 / 5)
forward(100)
right(360 * 2 / 5)
forward(100)
right(360 * 2 / 5)
for size in range(10, 100, 20):
star(size, 360*2/5)
input()