Python Statements
1. What is a Python Statement?
A statement is a single instruction that tells Python what to do.
👉 In simple words:
One action = one statement
Example
This is a statement because Python is doing one thing: printing text.
2. Simple (Single-Line) Statements
Most Python statements are written in one line.
Examples
Each line is a separate statement.
3. Multiple Statements (Many Lines)
You can write many statements one after another.
Example
Python reads statements line by line, from top to bottom.
4. Multiple Statements in One Line (Not Recommended)
Python allows more than one statement in one line using ;
But beginners should avoid this.
Example
👉 This works, but writing one statement per line is better and cleaner.
5. Assignment Statements
Assignment statements store values in variables.
Example
Here:
-
=means assign value -
Left side → variable
-
Right side → value
6. Output Statements (print)
print() is used to show output on the screen.
Example
Print variable value:
7. Input Statements (input)
input() is used to take data from the user.
Example
Input with Numbers
👉 int() is used to convert text into number.
8. Conditional Statements (Basic Idea)
Conditional statements make decisions.
Example
Here:
-
ifis a statement -
Python checks the condition
-
If true, it runs the code inside
9. Loop Statements (Basic Idea)
Loop statements repeat work.
Example (for loop)
Output:
10. Indentation in Statements (Very Important)
Statements inside a block must have same spaces.
Correct Example
Wrong Example
❌ This causes an error.
11. Common Statement Errors (Beginners)
❌ Missing indentation
❌ Misspelling keywords
❌ Forgetting quotes
❌ Using keyword as variable
Wrong Code
Correct Code
12. Simple Practice Examples
Example 1: Add Two Numbers
Example 2: User Input and Print
Example 3: Check Number
13. Summary (Python Statements)
✔ A statement is one instruction
✔ One line = one statement
✔ Python runs statements line by line
✔ Use indentation for blocks
✔ Keep code simple and clean
📘 Perfect for Beginners & eBook
This chapter is ideal for:
-
Python beginner eBooks
-
School / college students
-
Self-learners
If you want next, I can write:
-
Python Keywords (easy list)
-
if–else statements (step by step)
-
Loops (for & while)
-
Practice questions with answers
-
Bangla + English version
Just tell me 😊
