Hi, I’m Mingo.
Christmas is coming soon, wish everyone a merry Christmas in advance!
Today, I’m going to share with you how to draw a Christmas tree in Python, in various versions, from the humble to the deluxe, much like a beginner to an advanced bald programmer.
This paper involves the code download links: wwe.lanzout.com/i2YJ5xx6n4j
# Christmas Tree – Civilian edition
The first is a simple combination of the most basic shapes (circle and square) that anyone with a turtle background can draw.
The following code
# Christmas Tree – Advanced edition
Above the Christmas tree, are novice practice use, can only amuse themselves, not real, not tall enough.
Redesign with lines, drawing with strokes, slow work makes fine work
The code is as follows:
# Christmas Tree – Deluxe edition
On the basis of the advanced version, a few modifications are made:
- Day turns into night
- Hang some apples on it
- Snowflakes are perfect for Christmas
It’s pretty good. I can already hear Jingle Bell. Haha
The code is as follows:
# Silent Night – Christmas Fruit
After all, tomorrow is Christmas Day, and tonight is Christmas Eve, so it’s hard not to have a red apple
The code is as follows: