Python Getting Started

1. What is Python?

Python is a simple and powerful programming language.
It is easy to read and easy to write.

People use Python for:

  • Websites

  • Mobile and desktop apps

  • Data analysis

  • Artificial Intelligence (AI)

  • Automation (saving time)

πŸ‘‰ Python looks almost like normal English, so beginners love it.

2. Why Learn Python?

Python is popular because:

  • Easy to learn

  • Less code, more work

  • Used by big companies

  • Good for beginners and professionals

Example:

print("Hello, World!")

This single line can show text on the screen.

3. Installing Python

Step 1: Download Python

Go to the official Python website:
πŸ‘‰ https://www.python.org

Click Download Python.

Step 2: Install Python

During installation:
βœ” Check β€œAdd Python to PATH”
βœ” Click Install Now

Step 3: Check Python Installation

Open Command Prompt (Windows) or Terminal (Mac/Linux)
Type:

python --version

If Python is installed, you will see the version number.

4. Running Your First Python Program

There are two easy ways to run Python.

Method 1: Using Python Interactive Mode

Open Command Prompt / Terminal
Type:

python

You will see something like:

>>>

Now type:

print("Hello Python")

Output:

Hello Python

πŸ‘‰ This is called Interactive Mode.
It is good for testing small code.

Method 2: Using a Python File (Best Way)

Step 1: Create a File

Create a new file and name it:

hello.py

Step 2: Write Code

Inside the file, write:

print("Hello, World!")
print("Welcome to Python")

Step 3: Run the File

Open Command Prompt in the file location and type:

python hello.py

Output:

Hello, World!
Welcome to Python

5. Understanding Your First Python Code

print("Hello, World!")

Explanation:

  • print β†’ shows output on the screen

  • "Hello, World!" β†’ text message

  • () β†’ used to pass data to print

6. Python Indentation (Very Important)

Python uses spaces, not { }.

Correct Example

if 5 > 2:
print("Five is greater than two")

Wrong Example

if 5 > 2:
print("Error")

❌ This will give an error.

πŸ‘‰ Always use 4 spaces.

7. Python Comments

Comments are notes for humans.

Single-Line Comment

# This is a comment
print("Python is easy")

Multi-Line Comment

"""
This program prints a message
"""

print("Hello")

8. Python Variables (First Look)

Variables store values.

name = "Ravi"
age = 20

Print them:

print(name)
print(age)

9. Taking Input from User

Python can ask questions.

name = input("Enter your name: ")
print("Hello", name)

Input with Numbers

age = int(input("Enter your age: "))
print("Next year you will be:", age + 1)

10. Your First Small Program

Program: Add Two Numbers

a = int(input("Enter first number: "))
b = int(input("Enter second number: "))
sum = a + b
print(“Sum is:”, sum)

11. Common Beginner Mistakes

❌ Forgetting indentation
❌ Misspelling print
❌ Forgetting quotes for text
❌ Not converting input to number

Example mistake:

print(Hello) # Error

Correct:

print("Hello")

12. Summary (Getting Started)

βœ” Python is easy and powerful
βœ” Can run Python in terminal or file
βœ” print() shows output
βœ” Spaces are important
βœ” Input is text by default

πŸ“˜ Perfect for eBook

This chapter is ideal for:

  • Beginner Python eBooks

  • School & college students

  • Self-learning readers

If you want next, I can write:

  • Python Syntax & Variables (Next Chapter)

  • Python in Bangla + English

  • Practice exercises with answers

  • MCQs for beginners

  • PDF / EPUB ready formatting

Just tell me 😊

You may also like...