clock-using-trutle


As we know the clock is used for measuring time. The clock indicates hours, minutes, and seconds by hands-on moving in a clockwise direction.


Turtle is used for drawing the clock it is the same as a normal clock which is also used for measuring time.



</h2>Code:<h2>

In the following code, we will import the turtle module from turtle import *, import turtle. The turtle() method is used to make objects.
turtle.Screen() is used to show the screen on which we draw the shapes.
clock.color(‘cyan’) is used to give the color to the clock.
clock.width(5) is used to set the clock width.
clock.penup() is used to pick up the pen.
clock.right(90) is used to move the turtle in the right direction.
clock.forward(100) is used to move the turtle in the forward direction.
val += 1 is used in increment value by 1.
clock.fillcolor(‘Green’) is used to fill the color in the clock.
clock.circle(7) is used to draw the circle with radius 7.
clock.begin_fill() is used to start filling color in the clock.
clock.end_fill() is used to end the filling color in the clock.

Output:

After running the above code, we get the following output in which we can see the clock is drawn on the screen.


Screenshot (331) Screenshot (332) Screenshot (333) Screenshot (334) Screenshot (335)