Worksheets › Class 11 › Getting Started with Python
Class 11 · Computer Science worksheetGetting 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.
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.
Python is:
- an assembly language
- a compiled-only language
- a machine language
- a high-level, interpreted language
Answer
(d) a high-level, interpreted language
- 2.
What does this program print? print((19 + 8) // 6 % 5)
- 14
- 27
- 8
- 4
Answer
(d) 4
brackets first, then // and % from left to right
- 3.
What does this program print? print(type('9' * 6))
- <class 'str'>
- <class 'complex'>
- <class 'int'>
- <class 'dict'>
Answer
(a) <class 'str'>
the value is of type str
Section B · short answer
- 4.
Name the five kinds of Python tokens with an example of each.
Answer
Keywords (if), identifiers (marks), literals (25, 'hi'), operators (+, ==) and punctuators (:, (, ,).
- 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
- 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.