Skip to main content

Posts

Showing posts from May, 2021

Python Turtle Tutorials : Program to create a Ninja Circle

 Python Turtle tutorials Program to create amazing  Ninja Circle logo design in Python.  Code :  """ Program to create a Bi-pyramid structure Source : CODE PROBLEM (Youtube) """ import turtle turtle.Screen().bgcolor( "black" ) # set the background color to black turtle.speed( 0 ) # the fastest speed turtle.pensize( 2 ) # set the width of the drawing pen rainbow = [ 'red' , 'orange' , 'yellow' , 'green' , 'blue' , 'indigo' ] for i in range ( 110 ): turtle.color(rainbow[i% 6 ]) turtle.fd( 100 ) turtle.right( 28 ) turtle.fd( 30 ) turtle.left( 90 ) turtle.fd( 70 ) turtle.right( 30 ) turtle.fd( 50 ) turtle.penup() turtle.setposition( 0 , 0 ) turtle.pendown() turtle.right( 1 ) #hide the turtle after the shape has been drawn turtle.hideturtle() turtle.done() Output :      Learn through video : https://youtu.be/DhWbPnVfonY

Python Turtle tutorials : Create a Bi-Pyramid structure

 Python Turtle Tutorials  Create a Bi-Pyramid structure using Python  Code :           """ Program to create a Bi-pyramid structure Source : CODE PROBLEM (Youtube) """ import turtle scr = turtle.Screen() # create screen object scr.bgcolor( 'black' ) turtle.speed( 0 ) # the fastest speed turtle.pensize( 2 ) # set the width of the drawing pen turtle.color( 'skyblue' ) # set pencolor to 'skyblue' for i in range ( 30 ): turtle.fd(i* 10 ) turtle.right( 120 ) for j in range ( 29 , 0 ,- 1 ): turtle.fd(j* 10 ) # move forward turtle.left( 120 ) turtle.hideturtle() # hiding the turtle after the completion of the drawing turtle.done() # for holding the screen Output : Learn from video : Watch on youtube

Python Turtle Programs : Attractive Shell Design using Python

 Python Turtle Create a Shell like design using Python turtle. Code : """ Program to create a shell structure Source : CODE PROBLEM (Youtube) """ import turtle trt= turtle.Turtle() # create turtle object scr = turtle.Screen() # create screen object scr.bgcolor( 'black' ) colors = [ 'red' , 'orange' , 'yellow' , 'green' , 'blue' , 'indigo' , 'violet' , 'skyblue' ] trt.pensize( 3 ) # set the width of the drawing pen trt.speed( 0 ) # the fastest speed dis = 292 # initial value for c in colors: # using different colors at each iteration trt.color(c) for j in range ( 9 ): trt.left( 10 ) for i in range ( 3 ): trt.forward(dis) trt.left( 119 ) dis -= 4 trt.hideturtle() # hiding the turtle after the completion of the drawing turtle.done() # for holding the screen Output : Watch Video : Python Shell Design

Python Turtle : Create a attractive Petal Design

 Python Turtle Attractive Petal design in Python  import turtle # create the turtle object trt = turtle.Turtle() # create the screen object scr = turtle.Screen() #increase the pensize trt.pensize( 3 ) # set the background color to black scr.bgcolor( 'black' ) # set the pencolor to white colors = [ 'red' , 'orange' , 'yellow' , 'skyblue' , 'blue' , 'indigo' , 'violet' ] # increase the speed trt.speed( 0 ) # now first create a single petal # lets define the distance dis = 50 trt.color( "yellow" ) for color in range ( 20 ): for j in range ( 1 , 8 ): trt.left( 50 ) for i in range ( 2 ): trt.forward(dis) trt.left( 60 ) #rotate at 60 degree in clockwise trt.forward(dis) trt.left( 120 ) #rotate at 120 degree in clockwise dis = dis + 5 #hide the turtle after the shape has been drawn trt.hideturtle() turtle.done() Output : Learn thr...
Python turtle Create a sunflower using the Python turtle. import turtle # create the turtle object trt = turtle.Turtle() # create the screen object scr = turtle.Screen() #increase the pensize trt.pensize( 2 ) # set the background color to black scr.bgcolor( 'black' ) # increase the speed trt.speed( 0 ) # now first create a single petal # lets define the distance dis = 110 trt.begin_fill() trt.color( 'orange' , 'yellow' ) for j in range ( 1 , 25 ): trt.left( 15 ) for i in range ( 2 ): trt.forward(dis) trt.left( 30 ) # rotate at 60 degree in clockwise trt.forward(dis) trt.left( 150 ) # circle at center trt.end_fill() trt.goto( 0 ,- 40 ) trt.begin_fill() trt.color( 'orange' ) trt.circle( 40 ) trt.end_fill() #hide the turtle after the shape has been drawn trt.hideturtle() turtle.done()

Create a Rainbow Colored Benzene Structure using Python Turtle

  PYTHON TURTLE Create a Rainbow Colored Benzene Structure import turtle #import the turtle library trt = turtle.Turtle() #initialize the turtle object scr = turtle.Screen()     #initialize the Screen object scr.bgcolor( 'black' )          #set the background color to "black" scr.title( 'Color Benzene' ) #title of the scren trt.speed( 0 ) #speed of the drawing rainbow = [ 'red' , 'orange' , 'yellow' , 'green' , 'blue' , 'indigo' ] #colors to be used for i in range( 300 ): trt.pencolor(rainbow[i% 6 ]) trt.width(i/ 100 + 1 ) trt.forward(i) trt.left( 59 ) turtle.done() trt.hideturtle() Watch the video :

Graphics in Python using Turtle framework

  Python turtle Tutorial : Create an amazing Tiranga badge   Tiranga badge using Python Turtle. # first import the turtle module import turtle # create the turtle object trt = turtle.Turtle() #create the screen object scr = turtle.Screen() scr.setup( 850 , 850 ) # set the background color of the window (canvas) to balck scr.bgcolor( 'black' ) # increase the speed of the turtle trt.speed( 0 ) # increase the width of the turtle trt.pensize( 5 ) # now define list of colors required colors = [ 'orange' , 'white' , 'green' ] # now get into the central part of the logic radius = 150 # initially the radius is 150px # first define a for loop for every color for color in colors: # define a for loop for number of required iteration .. here we need 5 for i in range ( 6 ): # now define the loop for drawing the circles and changing the size for j in range ( 6 ): trt.color(color) trt.circle(radius) #define the variable...