Introduction
Hello, in this article we will see how to Write Happy Halloween in Python Turtle which is a library of python. Turtle lets us handle graphics very easily and smoothly. We will initially make the background color black, then we will write Happy Halloween and at last, we will draw some colored circles to make our design beautiful. We will understand the code line-by-line with the help of comments and in the end, the output is shown for the code. Click here to know about Halloween.
Code to Write Happy Halloween in Python Turtle
# importing libraries import turtle # initalizing a variable for turtle t = turtle.Turtle() # creating turtle screen screen = turtle.Screen() # setting up the screen size of canvas screen.setup(1200, 600) # changing the color of background to black screen.bgcolor('black') t.pencolor("red") t.penup() t.goto(-500, -20) # defining font size, color and type t.write('Happy Halloween', font=("Courier", 80, "italic")) # from here we are adding colourful circles on our canvas # deciding the color for circle t.fillcolor("blue") # start the filling color t.begin_fill() # radius of circle r = 10 t.goto(100, 100) t.circle(r) # end filling the colour t.end_fill() # making different circles and different positions for different colours t.fillcolor("white") t.begin_fill() t.goto(-100, -100) t.circle(r) t.end_fill() t.fillcolor("green") t.begin_fill() t.goto(-200, -200) t.circle(r) t.end_fill() t.fillcolor("orange") t.begin_fill() t.goto(100, -100) t.circle(r) t.end_fill() t.fillcolor("yellow") t.begin_fill() t.goto(-100, 100) t.circle(r) t.end_fill() t.fillcolor("pink") t.begin_fill() t.goto(-250, -150) t.circle(r) t.end_fill() t.fillcolor("white") t.begin_fill() t.goto(-250, 150) t.circle(r) t.end_fill() t.fillcolor("blue") t.begin_fill() t.goto(250, -150) t.circle(r) t.end_fill() t.fillcolor("yellow") t.begin_fill() t.goto(-300, -200) t.circle(r) t.end_fill() # holding the screen screen.mainloop()
Output:
Also Read:
- Radha Krishna using Python Turtle
- Drawing letter A using Python Turtle
- Wishing Happy New Year 2023 in Python Turtle
- Snake and Ladder Game in Python
- Draw Goku in Python Turtle
- Draw Mickey Mouse in Python Turtle
- Happy Diwali in Python Turtle
- Draw Halloween in Python Turtle
- Write Happy Halloween in Python Turtle
- Draw Happy Diwali in Python Turtle
- Extract Audio from Video using Python
- Drawing Application in Python Tkinter
- Draw Flag of USA using Python Turtle
- Draw Iron Man Face with Python Turtle: Tony Stark Face
- Draw TikTok Logo with Python Turtle
- Draw Instagram Logo using Python Turtle
- I Love You Text in ASCII Art
- Python Turtle Shapes- Square, Rectangle, Circle
- Python Turtle Commands and All Methods
- Happy Birthday Python Program In Turtle
- I Love You Program In Python Turtle
- Draw Python Logo in Python Turtle
- Space Invaders game using Python
- Draw Google Drive Logo Using Python
- Draw Instagram Reel Logo Using Python
- Draw The Spotify Logo in Python Turtle
- Draw The CRED Logo Using Python Turtle
- Draw Javascript Logo using Python Turtle
- Draw Dell Logo using Python Turtle
- Draw Spider web using Python Turtle