Worksheets › Class 11 › Brief Overview of Python
Class 11 · Informatics Practices worksheetBrief 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.
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.
In interactive mode, Python:
- cannot show any output
- runs only whole programs
- saves every line to a file first
- 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.
What does this print? print((24 + 8) % 6 + 5)
- 6
- 8
- 7
- 31
Answer
(c) 7
** first (right to left), then * / // %, then + and −, left to right
- 3.
What does this print? print((21 + 2) / 2)
- 11.5
- 12.5
- 11.0
- 22.0
Answer
(a) 11.5
/ always gives a float; Python prints a whole float with .0
Section B · short answer
- 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.
- 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
- 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.