đ Python āĻļেāĻা āĻļুāϰু āĻāϰি: Syntax āĻāϰ Semantics – āĻāĻāĻĻāĻŽ āϏāĻšāĻ āĻাāώাā§
Welcome to the very first step of your Python journey!
āĻāĻ āĻŦ্āϞāĻে āĻāĻŽāϰা āĻাāύāĻŦ Python Programming-āĻāϰ āϏāĻŦāĻেā§ে āĻŽৌāϞিāĻ āĻ āĻুāϰুāϤ্āĻŦāĻĒূāϰ্āĻŖ āĻĻুāĻি āĻিāύিāϏ: Syntax āĻāϰ Semantics।
đ Python Programming āĻļিāĻāϤে āĻšāϞে Syntax āĻāϰ Semantics āĻাāύāϤেāĻ āĻšāĻŦে āĻেāύ?
- ✔️ Syntax āĻুāϞ āĻšāϞে āĻোāĻĄ āĻাāϞāĻŦেāĻ āύা
- ✔️ Syntax āĻ িāĻ āĻšāϞেāĻ āϝāĻĻি āĻোāĻĄ āĻুāϞ āĻাāĻ āĻāϰে, āϏেāĻা semantics āĻুāϞ
đ Syntax āĻী?
Syntax āĻŽাāύে āĻšāϞো āĻোāύো āĻĒ্āϰোāĻ্āϰাāĻŽিং āĻাāώাā§ āĻোāĻĄ āϞেāĻাāϰ "grammar" āĻŦা āĻŦ্āϝাāĻāϰāĻŖ।
print("Welcome to Python")
print("Welcome to Python"
đ§ Semantics āĻী?
Semantics āĻŦোāĻাā§ āĻোāĻĄ āĻাāϞাāύোāϰ āĻĒāϰ āϏেāĻি āĻী āĻাāĻ āĻāϰāĻে, āϤাāϰ āĻŽাāύে āĻŦা āĻŦ্āϝাāĻ্āϝা।
a = 5
b = 0
c = a / b # ZeroDivisionError āĻšāĻŦে
đ Python-āĻ Comment āϞেāĻাāϰ āύিā§āĻŽ
✅ Single-line Comment
# āύিāĻে āĻāĻāĻাāϰেāϰ āύাāĻŽ print āĻāϰা āĻšā§েāĻে
print("Riya")
✅ Multi-line Comment
'''
āĻāĻ āĻোāĻĄ āĻŦ্āϞāĻāĻা
āĻāĻāĻাāϰেāϰ age print āĻāϰāĻŦে।
'''
print(23)
đ¤ Python Syntax Rules – āĻŦিāϏ্āϤাāϰিāϤ
1️⃣ Case Sensitivity
roll = 21
Roll = 45
print(roll) # 21
print(Roll) # 45
2️⃣ Indentation – Code Structure āĻŦোāĻাāϤে āĻŦ্āϝāĻŦāĻšৃāϤ āĻšā§
marks = 90
if marks >= 80:
print("Distinction")
print("Evaluation complete")
3️⃣ Line Continuation
total_score = 20 + 30 + 40 + \
25 + 35
4️⃣ Multiple Statements in One Line
x = 5; y = 10; print(x + y)
đ§Ē Python Semantics Explained
đš Variable Assignment
age = 22 # int
name = "Riya" # str
print(type(age)) #
print(type(name)) #
đš Type Inference – Dynamic Typing
status = True
print(type(status)) # bool
status = "Active"
print(type(status)) # str
⚠️ Common Syntax & Semantic Errors
❌ IndentationError
if True:
print("Yes") # Wrong
❌ NameError
total = amount + 10 # āϝāĻĻি amount define āύা āĻĨাāĻে
❌ ZeroDivisionError
x = 10
y = 0
z = x / y
đ Nested Indentation Example
if True:
print("Start")
if False:
print("Will not print")
print("Still inside outer if")
print("Outside all blocks")
Start
Still inside outer if
Outside all blocks
đ āĻāĻāĻেāϰ āĻŦ্āϞāĻে āϝা āĻļিāĻāϞেāύ:
- Syntax vs Semantics āĻĒাāϰ্āĻĨāĻ্āϝ
- Python-āĻ comments āĻিāĻাāĻŦে āϞিāĻāĻŦেāύ
- Indentation āĻেāύ āĻুāϰুāϤ্āĻŦāĻĒূāϰ্āĻŖ
- Variable āĻāĻŦং Dynamic Typing
- Common āĻুāϞ āĻāĻŦং āϏāĻŽাāϧাāύ
đ āĻĒāϰāĻŦāϰ্āϤী āĻŦ্āϞāĻে āĻী āĻāϏāĻে?
- đ Variables
- đ Data Types
- đ Operators
- đ Input / Output in Python
đŖ āĻāĻĒāύাāϰ Turn!
āĻāĻ āĻŦ্āϞāĻ āϝāĻĻি āĻāĻĒāύাāϰ āĻāĻĒāĻাāϰে āĻāϏে, āϤাāĻšāϞে āĻ āύ্āϝāĻĻেāϰ āϏāĻ্āĻে āĻļেā§াāϰ āĻāϰুāύ, comment āĻāϰুāύ, āĻāϰ āύিā§āĻŽিāϤ āĻāϰ্āĻা āĻাāϞিā§ে āϝাāύ।
Happy Pythoning! đ