forked from nishitpanchal395/projecthactoberfest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTurtle_program_in_python.py
More file actions
36 lines (29 loc) · 876 Bytes
/
Turtle_program_in_python.py
File metadata and controls
36 lines (29 loc) · 876 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 9 21:06:40 2021
@author: DHIRAJ
"""
# Import the turtle library for beautiful graphics
import turtle as tur
# Set the background color as black,
# pensize as 2 and speed of drawing
# curve as 10(relative)
tur.bgcolor('black')
tur.pensize(2)
tur.speed(10)
x=0
# Iterate for six times
for i in range(6):
if(i>x):
# Choose your color combination
for color in ('red', 'magenta', 'blue',
'cyan', 'green', 'white',
'yellow'):
tur.color(color)
# Draw a circle of 100 size
tur.circle(100)
# Move 10 pixels left to draw another circle and keep drawing till a beautiful graphics get formed
tur.left(10)
i=i-1 #to reduce the value for i so that the for loop gets terminated
# Hide the turtle cursor which drew the circle
tur.hideturtle()