Boards
Federal Board (FBISE)865 chapters Punjab Board401 chapters KPK Board472 chapters Sindh Board505 chapters AJK Board436 chapters Balochistan Board290 chaptersUniversity
Mechanical Soon Electrical Soon IT Soon Medical SoonLoading official notes...
Welcome to Chapter 3 of the Class 11 Computer Science (New National Curriculum) under the Federal Board (FBISE) Islamabad. This chapter introduces students to the core concepts of computer programming using Python, a high-level, interpreted, and dynamically typed programming language known for its readability and simplicity.
Programming is the process of giving instructions to a computer to solve a problem. Python executes instructions sequentially or via control structures. A variable is a named memory location used to store data, while data types define the kind of data a variable can hold (e.g., int, float, str, bool).
# Example of variable declaration and basic I/O
name = input("Enter your name: ")
print("Welcome to FBISE Python Programming,", name)Control flow allows execution of specific blocks of code based on conditions or repetitions.
if, elif, and else are used to make decisions.for loops are used for definite iteration (sequence traversal), while while loops are used for indefinite iteration based on a boolean condition.# Example of Conditional and Loop Structure
score = 85
if score >= 80:
print("Grade: A+")
else:
print("Grade: B or lower")
# For loop example
for i in range(1, 4):
print("Iteration number:", i)Functions allow code reuse and modularity. In Python, functions are defined using the def keyword.
def calculate_area(length, width):
return length * width
# Function call
print("Area is:", calculate_area(5, 4))1. Always trace code dry-runs before writing outputs in subjective questions.
2. Remember that Python is case-sensitive (e.g., Print will cause a NameError; it must be print).
3. Pay close attention to indentation, as Python uses whitespace instead of braces {} to define blocks of code.
Python is an interpreted language, meaning its source code is translated and executed line-by-line by the Python interpreter at runtime rather than being converted into machine code beforehand by a compiler. This allows for easier debugging and rapid development, though execution speed can sometimes be slower compared to compiled languages like C++.
Python uses strict indentation (whitespace) to enforce clean, readable, and uniform code formatting across all developers. Omitting proper indentation results in an IndentationError, ensuring that the visual structure of the code matches its logical execution flow.
Modules in Python are files containing Python code such as functions or classes that can be imported using the 'import' keyword. They promote modular programming, allowing developers to break down large programs into smaller, manageable, and reusable files.
No solved past-paper questions are linked to Programming Fundamentals (Python) yet. The MCQs tab above is ready to practise from meanwhile.
Assalam-o-Alaikum Federal Board Class 11 students! Chapter 3 Python programming ke hawale se bohot important hai. Is section mein hum core concepts koasan Roman Urdu mein samjhenge taake aap paper mein achay marks secure kar sakein.
Variables basically computer ki memory mein ek container ki tarah hain jo data store karte hain. Python mein variable banate waqt data type likhne ki zaroorat nahi parti (dynamic typing). Maslan: age = 18 likhte hi Python khud samajh jata hai ke yeh integer hai. Basic data types mein int (numbers), float (decimals), str (text), aur bool (True/False) shamil hain.
Program ki execution ko control karne ke liye conditions aur loops use hote hain. if-elif-else se hum decisions lete hain. Jabke for aur while loops se hum ek hi code ko bar bar execute kar sakte hain. Yaad rakhein, Python mein indentation (spaces/tabs) ka bohot khayal rakhna parta hai kyunke braces {} ki jagah indentation block define karti hai.
Functions code ko modular banate hain. def keyword se function define hota hai. Board exams mein aksar code snippet de kar output ya error poochha jata hai, is liye syntax (maslan print() lowercase mein hona) achi tarah yaad karein.
Python is an interpreted language, meaning its source code is translated and executed line-by-line by the Python interpreter at runtime rather than being converted into machine code beforehand by a compiler. This allows for easier debugging and rapid development, though execution speed can sometimes be slower compared to compiled languages like C++.
Python uses strict indentation (whitespace) to enforce clean, readable, and uniform code formatting across all developers. Omitting proper indentation results in an IndentationError, ensuring that the visual structure of the code matches its logical execution flow.
Modules in Python are files containing Python code such as functions or classes that can be imported using the 'import' keyword. They promote modular programming, allowing developers to break down large programs into smaller, manageable, and reusable files.