Day 2 – Writing Your First Python Program Using print() | 60 Days Python Crash Course | ElectroLab

Welcome to Day 2 of the 60 Days Python Crash Course at ElectroLab.in! Yesterday, we covered the basics of what Python is, how to install it, and set up your IDE. Today, we’ll dive straight into writing your first Python program using the print()
function — the most basic yet powerful starting point for every Python developer.
If you’ve successfully installed Python and your IDE (like VS Code or PyCharm), you’re all set to write your first Python program. Let’s get started!

🐍 What is the print()
Function in Python?
The print()
function is used to display messages, numbers, or any other output to the screen. It’s often the first command you learn when beginning programming — and in Python, it’s incredibly simple and clean to use.
Here’s a basic example of the first Python program:
print("Hello, World!")
This single line of code outputs:
Hello, World!
Pretty cool, right?
✍️ Writing Your First Python Program
Follow these steps to write and run your first Python program using print()
:
Download a Python IDE – Link
✅ Step 1: Open Your IDE or Text Editor
Use any editor you installed on Day 1:
✅ Step 2: Create a New File
- Create a new file
- Name it something like
day2.py
✅ Step 3: Write Your Code
Inside day2.py
, type:
print("Welcome to ElectroLab’s Python Crash Course!")
print("This is my first Python program.")
✅ Step 4: Run the Program
- In VS Code: Right-click anywhere and select “Run Python File in Terminal”
- In PyCharm: Click the green run arrow ▶️
- In terminal: Open the folder and type:
python day2.py
You should see the following output:
Welcome to ElectroLab’s Python Crash Course!
This is my first Python program.
Congratulations! 🎉 You just wrote your first Python program.
🔍 Understanding print()
The print()
function in Python is versatile. It can print:
- Strings (text)
- Numbers
- Variables
- Expressions
- Multiple items separated by commas
Examples:
# Printing numbers
print(2025)
# Printing variables
name = "ElectroLab"
print("Hello", name)
# Printing expressions
print("2 + 3 =", 2 + 3)
🧠 How print()
Works
The print()
function sends output to the standard output device (usually your screen). It automatically adds a newline (\n
) after each call unless you tell it not to using the end
parameter.
Example:
print("Hello", end=" ")
print("World!")
Output:
Hello World!
This control is useful when formatting output in a single line.
✅ Summary
In today’s lesson, you:
- Learned how to write your first Python program
- Used the
print()
function to display text and data - Understood how
print()
can be used in different scenarios - Gained confidence running Python files from the terminal or IDE
This is your first real step into actual programming. The more you play with print()
, the more comfortable you’ll feel moving forward.
💡 Practice Time
Try the following:
- Print your name, age, and favorite programming language using separate
print()
statements. - Print a quote of your choice with quotation marks around it.
- Use variables to store your name and age, then print a sentence using both.
- Print this exact pattern using a single line of code:
Python is fun! Python is fun! Python is fun!
Hint: Use:
print("Python is fun! " * 3)
- Write a program that outputs:
2 + 3 = 5
❓ Frequently Asked Questions (FAQ)
Q1: What is the first Python program usually written by beginners?
A basic print("Hello, World!")
is the traditional first Python program. It introduces how to print output in Python.
Q2: Can the print()
function display multiple items?
Yes! You can separate multiple items with commas like print("Sum =", 2 + 3)
.
Q3: Is print
a function or a command?
In Python 3, print()
is a built-in function.
Q4: Can I use single or double quotes with print()
?
Yes, both 'Hello'
and "Hello"
are valid string formats in Python.
Q5: What should I do if my first Python program doesn’t run?
Check:
- You saved the file with
.py
extension - Python is installed correctly
- You used proper indentation and syntax