index

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.

PAPER NO.
05
COMPUTER SCIENCE
CHAPTER
WISE
Roll No.(in Figures): (in Words):
Unit: 3
Introduction to Python Programming
Objective Type
Maximum Marks: 10
Time Allowed : 15 Minutes
ABCD
1ABCD
2ABCD
3ABCD
4ABCD
ABCD
5ABCD
6ABCD
7ABCD
8ABCD
ABCD
9ABCD
10ABCD
NOTE: Four possible answers A, B, C and D to each question are given. The choice which you think is correct, fill that circle in front of that question with Marker or Pen ink. Cutting or filling two or more circles will result in zero mark in that question.
Q1.10

1. Which of the following Python Programming have?

(A) Complex structure(B) Ability to handle complex structure(C) Beginners language(D) Professional language

2. Which short key is used to run script in both Vs code and IDLE?

(A) F1(B) F5(C) F2(D) F9

3. Which of the following is not a variable?

(A) variable11(B) 11variable(C) Var(D) Air

4. If a=10, b=3. What is the output of a**b?

(A) 100(B) 1000(C) 10000(D) 100000

5. Which of the following is right associate?

(A) *(B) ( )(C) +(D) **

6. What will be the output of: print(10 // 3)?

(A) 3.333(B) 3(C) 1(D) 4

7. What is the result of 5 > 3 and 2 < 1?

(A) True(B) False(C) Error(D) None

8. Which symbol is used for comments in Python?

(A) //(B) /*(C) #(D) —

9. Which of the following steps is NOT part of the basic programming process?

(A) Write Code(B) Compile/Interpret(C) Execute(D) Ignore Errors

10. What should you do when installing Python to run it from the command line more easily?

(A) Uncheck “Add Python to PATH”(B) Choose a different IDE(C) Check “Add Python to PATH”(D) Install only the IDE
Answer Key: 1-B, 2-B, 3-B, 4-B, 5-D, 6-B, 7-B, 8-C, 9-D, 10-C
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.

786Times 786Times 786Times 786Times 786Times 786Times 786Times 786Times 786Times 786Times 786Times 786Times 786Times 786Times 786Times
Roll No.(in Figures): (in Words):
Unit: 3
Introduction to Python Programming

Subjective Type

Maximum Marks: 40
Time Allowed: 1:45 Hours
(PART – I)
Q2.  Write short answers to any four questions.4×2=8
  1. (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.
  2. (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 (here age stores 15).
  3. (iii)Define Arithematic operators.
    Arithmetic operators perform mathematical operations on numbers: + − * / // % ** (add, subtract, multiply, divide, floor divide, modulus, power).
  4. (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.
  5. (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.
  6. (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.
Q3.  Write short answers to any four questions.4×2=8
  1. (i)Solve the following expressions 8+3*4–2**2
    Power first: 2**2 = 4. Then multiplication: 3*4 = 12. Then left to right: 8 + 12 − 4 = 16.
  2. (ii)Why logical operators are used?
    Logical operators combine two or more conditions and return True or False, used in decision-making (if statements).
  3. (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.
  4. (iv)What are logical operators and name all three?
    Operators that work on Boolean values/conditions. The three are and, or, not.
  5. (v)How do you get user input in python?
    Using the input() function. Example: name = input("Enter name: "). It returns a string.
  6. (vi)What is operator precedence? Give an example.
    The order in which operators are evaluated. Example: 5 + 2 * 3 = 11 because * is done before +.
Q4.  Write short answers to any four questions.4×2=8
  1. (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.
  2. (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.
  3. (iii)Define single line comment with example.
    A comment on one line beginning with #. Example: # This prints a message
  4. (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").
  5. (v)Discuss three basic data types in python.
    int: whole numbers (10). float: decimal numbers (3.14). str: text in quotes (“Ali”).
  6. (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.
(PART- II)
Note: Attempt any TWO questions.2×8=16
Q.5.Write a program in python that will take a name from user and display greeting message to the given name.8
Program:
# Greeting program
name = input("Enter your name: ")
print("Hello, " + name + "! Welcome to Python.")
Output: Enter your name: Ali → Hello, Ali! Welcome to Python.
Q.6.Explain the input() and print() functions with examples.8
input(): reads data typed by the user and returns it as a string. Example: 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)
Q.7.What are the basic data types in python? Explain integers, floats, strings, and Booleans with examples.8
Data types tell Python what kind of value a variable holds.
Integer (int): whole numbers, x = 10
Float: decimal numbers, pi = 3.14
String (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'>

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button
error: Content is protected !!