keshavsingh4522 / hacktoberfest

Submit Just 4 PRs to earn SWAGS and Tshirts🔥
https://hacktoberfest.digitalocean.com/
Creative Commons Zero v1.0 Universal
843 stars 3.92k forks source link

Feature: Want to add Drawing with Turtle module in Python #1406

Open ChitSuThwin opened 2 years ago

ChitSuThwin commented 2 years ago

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

Karssido commented 2 years ago

My code is ready for the drawing of shapes with the user input number of sides:

Python program to user input pattern

using Turtle Programming

import turtle #Outside_In import turtle import time import random

print ("This program draws shapes based on the number you enter in a uniform pattern.") num_str = input("Enter the side number of the shape you want to draw: ") if num_str.isdigit(): squares = int(num_str)

angle = 180 - 180*(squares-2)/squares

turtle.up

x = 0 y = 0 turtle.setpos(x, y)

numshapes = 8 for x in range(numshapes): turtle.color(random.random(), random.random(), random.random()) x += 5 y += 5 turtle.forward(x) turtle.left(y) for i in range(squares): turtle.begin_fill() turtle.down() turtle.forward(40) turtle.left(angle) turtle.forward(40) print (turtle.pos()) turtle.up() turtle.end_fill()

time.sleep(11) turtle.bye()

If it is ok, Please assign me this issue under the label Hacktoberfest2021