Class 10 Computer Science Chapter 3 Test 5 | Python Programming
Class 10 computer chapter 3 python programming test series pdf

Prepare for the Class 10 Computer Science and Entrepreneurship Chapter 3: Introduction to Python Programming – Test 5, designed according to the latest Punjab Board 2027 Model Papers and the new syllabus issued by PECTAA Punjab. This full unit test is part of our comprehensive chapter-wise test series for Class 10 students. Practice important Python programming concepts, strengthen your problem-solving skills, and improve your understanding of programming fundamentals with this exam-oriented test. It is a useful preparation resource for students appearing in the 2027 Matric Annual Examinations under all Punjab Boards.
WISE
Introduction to Python Programming
Time Allowed : 15 Minutes
1. Which of the following Python Programming have?
2. Which short key is used to run script in both Vs code and IDLE?
3. Which of the following is not a variable?
4. If a=10, b=3. What is the output of a**b?
5. Which of the following is right associate?
6. What will be the output of: print(10 // 3)?
7. What is the result of 5 > 3 and 2 < 1?
8. Which symbol is used for comments in Python?
9. Which of the following steps is NOT part of the basic programming process?
10. What should you do when installing Python to run it from the command line more easily?
4:
10 ** 3 = 1000 | 6: 10 // 3 = 3 | 7: True and False = False | 3: a variable name cannot start with a digit.Here is Subjective Part of Model Paper 2027.
Introduction to Python Programming
Subjective Type
Time Allowed: 1:45 Hours
- (i)Define computer programming.Computer programming is the process of writing a set of instructions (code) in a programming language that tells a computer how to perform a task.
- (ii)Why variable name used in python? Give an example.A variable name is used to store and refer to data in memory. Example:
age = 15(hereagestores 15). - (iii)Define Arithematic operators.Arithmetic operators perform mathematical operations on numbers:
+ − * / // % **(add, subtract, multiply, divide, floor divide, modulus, power). - (iv)Why are comments important in programming?Comments explain the code, make it easy to read and maintain, and help others understand it. Python ignores them during execution.
- (v)Describe the difference between integer and float data types in python.An integer (
int) is a whole number without a decimal point, e.g. 25. A float is a number with a decimal point, e.g. 25.5. - (vi)Write any three main rules for naming variables in python?1) Must start with a letter or underscore, not a digit. 2) Can contain only letters, digits and underscore (no spaces). 3) Cannot be a Python keyword; names are case-sensitive.
- (i)Solve the following expressions 8+3*4–2**2Power first: 2**2 = 4. Then multiplication: 3*4 = 12. Then left to right: 8 + 12 − 4 = 16.
- (ii)Why logical operators are used?Logical operators combine two or more conditions and return True or False, used in decision-making (if statements).
- (iii)Why it is compulsory to close multi-line comment?If it is not closed (
"""…"""), Python treats the rest of the code as part of the comment/string and gives a syntax error. - (iv)What are logical operators and name all three?Operators that work on Boolean values/conditions. The three are
and,or,not. - (v)How do you get user input in python?Using the
input()function. Example:name = input("Enter name: "). It returns a string. - (vi)What is operator precedence? Give an example.The order in which operators are evaluated. Example:
5 + 2 * 3= 11 because * is done before +.
- (i)Explain the purpose of input and output functions.
input()takes data from the user through the keyboard;print()displays results or messages on the screen. - (ii)Explain the method of installing python.Download the installer from python.org, run it, tick “Add Python to PATH”, click Install Now, then verify with
python --version. - (iii)Define single line comment with example.A comment on one line beginning with
#. Example:# This prints a message - (iv)What is the purpose of print() statement in python?It displays text, numbers or variable values as output on the screen. Example:
print("Hello"). - (v)Discuss three basic data types in python.int: whole numbers (10). float: decimal numbers (3.14). str: text in quotes (“Ali”).
- (vi)Explain the basic python syntax and structure.Python uses indentation (not braces) to define blocks, statements end at the line end,
#is used for comments, and code runs top to bottom.
# Greeting program
name = input("Enter your name: ")
print("Hello, " + name + "! Welcome to Python.")
Output: Enter your name: Ali → Hello, Ali! Welcome to Python.age = input("Age: "); use int(input()) for numbers.print(): shows output on screen. Example:
print("Age is", age). It can print text, numbers and variables, with sep and end options.
name = input("Name: ")
print("Welcome", name)Integer (int): whole numbers,
x = 10Float: decimal numbers,
pi = 3.14String (str): text in quotes,
s = "Python"Boolean (bool): True or False,
passed = True
print(type(10)) # <class 'int'>
print(type(3.14)) # <class 'float'>
print(type("Hi")) # <class 'str'>
print(type(True)) # <class 'bool'>


