![]() The message object is passed using the write function to display on the screen. In the last part, we have put the message in the message object. Tur.write(message,move=False,align="center",font=("Arial",15,"bold")) Write a message On the screen tur.penup() We have used the for loop so that the turtle moves forward 40 steps and the angle in the right direction of 144 degrees. Draw the star tur.speed(1)įor the star, we have set the color and position of the star. The stamp () function puts the triangle shape at the given coordinates on the screen. We have set the heading position to 90 degrees so that it points North. In the above lines of code, we have simply drawn the bells. With the above code, we have drawn 6 balls on the tree 3 on both the left and right sides respectively 6. Draw balls on the Christmas Tree tur.penup() Here, we have created the trunk of the tree, and set the color to red We used only the right and forward functions to draw the trunk, 6. In this code, we have drawn the right part of the tree the same as the left and filled the tree with green color. In this piece of code, we have set the color of the tree to green and drawn the right half of the tree, Forward function is to move forward using the steps i.e forward(90), with left and right we have the set angle position to 150 degrees. Draw the right half of the Christmas tree tur.color("green") With scr object, we have set the screen’s color and title. Color in the tree trunk with a brown and blend in a darker shade to one side of the trunk. Add some lines around your star and gently smudge them outward to make the star look like it’s glowing. ![]() ![]() In this code, we have created the turtle and screen objects. Draw a star at the top of your tree with a pencil. Setting the turtle window = turtle.Screen() Importing the turtle module allows us to use its inbuilt methods and functions in our program. Complete Code to draw Christmas Tree using Python Turtle.Draw the right half of the Christmas tree Download Christmas Tree Line Drawing and use any clip art,coloring,png graphics in your website, document or presentation. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |