SOURCE CODE MAKE 3D HEXAGONAL SHAPE USING PYTHON(AVAILABLE)
- Getting to know python turtle library :
turtle
is a pre-installed Python library that enables users to create pictures and shapes by providing them with a virtual canvas. The onscreen pen that you use for drawing is called the turtle and this is what gives the library its name. In short, the Python turtle
library helps new programmers get a feel for what programming with Python is like in a fun and interactive way.
turtle
is a pre-installed Python library that enables users to create pictures and shapes by providing them with a virtual canvas. The onscreen pen that you use for drawing is called the turtle and this is what gives the library its name. In short, the Python turtle
library helps new programmers get a feel for what programming with Python is like in a fun and interactive way.turtle
is mainly used to introduce children to the world of computers. It’s a straightforward yet versatile way to understand the concepts of Python. This makes it a great avenue for kid to take their first steps in Python programming. That being said, the Python turtle
library is not restricted to little ones alone! It’s also proved extremely useful for adults who are trying their hands at Python, which makes it great for Python beginner.
With the Python turtle
library, you can draw and create various types of shapes and images. Here’s a sample of the kinds of drawings you can make with turtle
:
RUN THIS SOURCE CODE FOR OUTPUTπ
import turtleturtle.penup()turtle.setpos(-100,250)turtle.pendown()turtle.pencolor('olive')turtle.write('CODEATTRACTION',font=("Arial", 18, "bold"))turtle.penup()turtle.setpos(0,0)turtle.pendown()turtle.color("black", "white")turtle.colormode(1.0)SQUARES = 50SIDE = 150shade = 1.0for count in range(SQUARES):turtle.fillcolor(shade, shade, shade)turtle.begin_fill()turtle.left(360 // SQUARES)for side in range(4):turtle.forward(SIDE)turtle.left(90)turtle.end_fill()shade -= turtle.colormode() / float(SQUARES)turtle.penup()turtle.setpos(150,-270)turtle.pendown()turtle.pencolor('olive')turtle.write('CODEATTRACTION',font=("Arial", 12, "normal"))turtle.done()
HAPPY CODING :π
Comments
Post a Comment