Skip to content

Punjab (PTB) · Quarter book test · Free

10th Class Computer 2nd Quarter Book Paper

40 marks · 1 hour · 28 questions. Covers: UNIT 03: INTRODUCTION TO PYTHON PROGRAMMING, UNIT 04: CONTROL STRUCTURES IN PYTHON.

Your school name

10th Class Computer 2nd Quarter Book Paper

10th Class · Computer · Punjab (PTB)

Name: ____________Roll No: ________Class/Section: ________Date: ________Total marks: 40Time: 1 hour

Q1. Multiple choice questions (Attempt all · 12 × 1 = 12)

  1. In Python logical-and operator represented by:

    1. and

    2. or

    3. not

    4. &&

  2. Items inside a Python list are separated from each other using which punctuation?

    1. Semicolon(;)

    2. Colon(:)

    3. Commas(,)

    4. Dot(.)

  3. Install software tool means:

    1. Configuring necessary tools

    2. Configuring necessary tools & libraries

    3. Configuring necessary libraries

    4. Configuring OS libraries

  4. What does the function random.randint(1, 10) do?

    1. Generates a floating-point number between 1 and 10

    2. Generates a random integer between 1 and 10 inclusive

    3. Adds 1 and 10 together

    4. Finds the maximum value

  5. In Python logical-or represented by:

    1. and

    2. &&

    3. or

    4. ||

  6. PDB is a:

    1. Python Translator

    2. Python Module

    3. Python Debugger

    4. None of them

  7. Which function converts string to integer?

  8. if statement within an if statement:

    1. Multiple if

    2. if-elif-else

    3. if-else

    4. Nested if

  9. Popular Python IDE is:

    1. PyCharm

    2. VS Code

    3. IDLE

    4. All

  10. Which built-in Python function is used to generate a sequence of numbers, often used with for loops?

    1. print( )

    2. input( )

    3. range( )

    4. loop( )

  11. In Python, print( ) is a:

    1. Function

    2. Keyword

    3. Variable

    4. Library

  12. Output of the following code: for i in range(3): print(i)

    1. 0 1 2 3

    2. 0 1 2

    3. 1 2 3

    4. 3 2 1 0

Q2. Short questions (Attempt any 8 of 12 · 8 × 2 = 16)

  1. If x = 10 and y = 5, what will be the output of x >= y and x <= y?

  2. What is the purpose of regression testing?

  3. If x = True and y = False, what will be the output of not(x) and not(y)?

  4. What is the purpose of the end parameter in print( )?

  5. State any two advantages of using Google Colab.

  6. What are control structures? Name their main types.

  7. Discuss three basic data types in python.

  8. Can a Python list contain items of different data types? Give an example.

  9. Define the comparison operator with an example.

  10. Define a loop and the named types of loops used in Python.

  11. Differentiate between boolean and string variables in Python.

  12. Define a list in Python and write its basic syntax.

Q3. Long questions (Attempt any 3 of 4 · 3 × 4 = 12)

  1. Describe the types of variables used in Python.

  2. Write down the syntax to import the random library and generate a random number between 1 and 10.

  3. Write a program in Python that will take a name from user and display greeting message to the given name.

  4. What is control structure? Explain its importance.