Worksheets › Class 11 › Getting Started with Python

Class 11 · Computer Science worksheet

Getting Started with Python

CBSE Computer Science. Tokens, identifiers and keywords, data types, operators and precedence, type conversion, input and print, syntax, runtime and logical errors. Every sheet has 20 questions in three sections and an answer key, and the questions change every time.

Open a printable sample sheet

Sample questions

Real questions from this chapter, as the app sets them. Tap Answer to see the answer and working.

Section A · multiple choice

  1. 1.

    Python is:

    1. an assembly language
    2. a compiled-only language
    3. a machine language
    4. a high-level, interpreted language
    Answer

    (d) a high-level, interpreted language

  2. 2.

    What does this program print? print((19 + 8) // 6 % 5)

    1. 14
    2. 27
    3. 8
    4. 4
    Answer

    (d) 4

    brackets first, then // and % from left to right

  3. 3.

    What does this program print? print(type('9' * 6))

    1. <class 'str'>
    2. <class 'complex'>
    3. <class 'int'>
    4. <class 'dict'>
    Answer

    (a) <class 'str'>

    the value is of type str

Section B · short answer

  1. 4.

    Name the five kinds of Python tokens with an example of each.

    Answer

    Keywords (if), identifiers (marks), literals (25, 'hi'), operators (+, ==) and punctuators (:, (, ,).

  2. 5.

    What does this program print? Give (a) the first line (b) the second. a = 23 b = 1 - 23 print(a // b) print(a % b)

    Answer

    (a) −2; (b) −21

    a = 23, b = −22: // rounds down (towards minus infinity), and a = b × (a // b) + a % b

Section C · long answer

  1. 6.

    Explain the data types of Python with an example of each: number, boolean, sequence, None and mapping.

    Answer

    Numbers: int 25, float 2.5, complex 3 + 2j; bool True; sequences: str 'hi', list [1, 2], tuple (1, 2); None; mapping: dict {'a': 1}.

Fresh sheets for your child

In the app, every Getting Started with Python sheet is new: the app remembers the questions your child has already had and leaves them out. Print the sheet as a PDF, or use notebook mode and write the answers in a notebook.

Coming soon for Android and iPhone.

More Class 11 Computer Science