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

print("Hello Python")

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

x = 10
name = "Ravi"
print(x)

Each line is a separate statement.

3. Multiple Statements (Many Lines)

You can write many statements one after another.

Example

a = 5
b = 10
sum = a + b
print(sum)

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

x = 5; y = 10; print(x + y)

👉 This works, but writing one statement per line is better and cleaner.

5. Assignment Statements

Assignment statements store values in variables.

Example

age = 20
price = 99.50
city = "Delhi"

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("Welcome to Python")

Print variable value:

name = "Amit"
print(name)

7. Input Statements (input)

input() is used to take data from the user.

Example

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

Input with Numbers

age = int(input("Enter your age: "))
print("Age is:", age)

👉 int() is used to convert text into number.

8. Conditional Statements (Basic Idea)

Conditional statements make decisions.

Example

age = 18

if age >= 18:
print("You can vote")

Here:

  • if is 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)

for i in range(3):
print("Hello")

Output:

Hello
Hello
Hello

10. Indentation in Statements (Very Important)

Statements inside a block must have same spaces.

Correct Example

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

Wrong Example

if 5 > 2:
print("Error")

❌ This causes an error.

11. Common Statement Errors (Beginners)

❌ Missing indentation
❌ Misspelling keywords
❌ Forgetting quotes
❌ Using keyword as variable

Wrong Code

print(Hello)

Correct Code

print("Hello")

12. Simple Practice Examples

Example 1: Add Two Numbers

a = 10
b = 20
print(a + b)

Example 2: User Input and Print

city = input("Enter city name: ")
print("You live in", city)

Example 3: Check Number

num = 7

if num > 5:
print("Number is greater than 5")

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 😊

You may also like...