Hello, python lover in this blog post we will create a Holi
greeting using python. For creating greeting we will use turtle in Python. It’s
very easy and interesting, so let’s start with python code.
For creating greeting in python we will create a three file
in python:
1. alphabet.py
2. shape.py
3. main.py
Step 1: Create an alphabet.py file. In this
python file, we will set the coordination of all alphabet (A-Z) caps letters. So
it’s easy to print any sentence.
The code is following of
alphabet.py file:
Step2: create a shape.py file in this python file we
will create different functions for different designs for creating different
shapes in greeting like a star, square e.t.c.
The code is following for shape.py file:
Step3: At
last we will create the main file. This is the main python file in this file all
the above two python file (alphabet.py, shape.py) are imported. And we declare
the different message and turtle customization in this file. The code is the following:
Step4: Run the following code and also remember the
above three files is saved at the same path and you will have to run only main.py
file forsee the output like this:
Comments
Post a Comment