Worksheets › Class 11 › Brief Overview of Python

Class 11 · Informatics Practices worksheet

Brief Overview of Python

CBSE Informatics Practices. Identifiers and keywords, data types and type(), operators and precedence, //, % and **, type conversion, errors, if-elif-else, for and while loops, tracing programs. 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.

    In interactive mode, Python:

    1. cannot show any output
    2. runs only whole programs
    3. saves every line to a file first
    4. runs each statement as soon as it is typed at the >>> prompt
    Answer

    (d) runs each statement as soon as it is typed at the >>> prompt

  2. 2.

    What does this print? print((24 + 8) % 6 + 5)

    1. 6
    2. 8
    3. 7
    4. 31
    Answer

    (c) 7

    ** first (right to left), then * / // %, then + and −, left to right

  3. 3.

    What does this print? print((21 + 2) / 2)

    1. 11.5
    2. 12.5
    3. 11.0
    4. 22.0
    Answer

    (a) 11.5

    / always gives a float; Python prints a whole float with .0

Section B · short answer

  1. 4.

    Distinguish between interactive mode and script mode.

    Answer

    Interactive mode runs one statement at a time at the >>> prompt; script mode runs a whole program saved in a .py file.

  2. 5.

    What are x and y at the end? x = 9 y = 5 x = x // 5 x = x // 5 x = x // 4

    Answer

    x = 0, y = 5

    run each line in turn

Section C · long answer

  1. 6.

    Explain the arithmetic operators of Python with an example of each, and state their precedence.

    Answer

    + (7 + 2 = 9), − (7 − 2 = 5), * (7 * 2 = 14), / (7 / 2 = 3.5), // (7 // 2 = 3), % (7 % 2 = 1), ** (7 ** 2 = 49). ** is evaluated first (right to left), then *, /, //, %, then + and −, left to right; brackets change the order.

Fresh sheets for your child

In the app, every Brief Overview of 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 Informatics Practices