Class 10
Computer Science
Ch 5: Programming Fundamentals with Python
Python Syntax, Control Flow & Loops
Python Language Features
An interpreted, high-level, dynamically typed language known for clean readability and whitespace-based indentation for block scoping.
Core Python Control Flow Syntax:
# 1. Conditional Branching
age = int(input("Enter your age: "))
if age >= 18:
print("Eligible to vote")
else:
print("Not eligible yet")
# 2. For Loop with range()
for i in range(1, 6):
print("Square of", i, "is", i * i) Practice Questions (1)
View All Chapter Q&AMultiple Choice Questions (1)
MCQ 1
+1.00 Mark
In Python programming, blocks of code inside functions, loops, and conditions are designated by:
A
Curly braces { }
B
Indentation (whitespace)
C
Semicolons ;
D
Parentheses ( )
Correct:
Option B: Indentation (whitespace)
Explanation:
Python enforces code indentation (consistent spaces/tabs) to define structure and block scope, unlike C/C++ which uses curly braces.