Getting Started with Python
CBSE · Class 11 · Computer Science
NCERT Solutions for Getting Started with Python — CBSE Class 11 Computer Science.
Interactive on Super Tutor
Studying Getting Started with Python? Get the full interactive chapter.
Quizzes, flashcards, AI doubt-solver and a step-by-step study plan — built for ncert solutions and more.
1,000+ Class 11 students started this chapter today
28 worked solutions below. Unlock all 55 free in Super Tutor
EXERCISE
1Which of the following identifier names are invalid and why?Show solution
- 1st_Room — it starts with a digit, and an identifier cannot start with a digit.
- **Hundred`, which is not allowed in identifiers.
- total-Marks — it contains a hyphen `-`, which is not allowed in identifiers.
- True — it is a keyword/reserved word in Python.
Valid identifiers from the list are Serial_no.? No, it is also invalid because it contains a dot `.`, which is a special symbol.
So the invalid names are Serial_no., 1st_Room, Hundred$, total-Marks, and True.
Not sure why a step works? check your working in Super Tutor
2(a)Assign 10 to variable `length` and 20 to variable `breadth`.Show solution
```python
length = 10
breadth = 20
```
Not sure why a step works? check your working in Super Tutor
2(b)Assign the average of values of variables `length` and `breadth` to a variable `sum`.Show solution
So the assignment statement is:
```python
sum = (length + breadth) / 2
```
Not sure why a step works? check your working in Super Tutor
2(c)Assign a list containing strings 'Paper', 'Gel Pen', and 'Eraser' to a variable `stationery`.Show solution
```python
stationery = ['Paper', 'Gel Pen', 'Eraser']
```
Not sure why a step works? check your working in Super Tutor
2(d)Assign the strings 'Mohandas', 'Karamchand', and 'Gandhi' to variables `first`, `middle` and `last`.Show solution
```python
first = 'Mohandas'
middle = 'Karamchand'
last = 'Gandhi'
```
Not sure why a step works? check your working in Super Tutor
2(e)Assign the concatenated value of string variables `first`, `middle` and `last` to variable `fullname`. Make sure to incorporate blank spaces appropriately between different parts of names.Show solution
```python
fullname = first + ' ' + middle + ' ' + last
```
Not sure why a step works? check your working in Super Tutor
3(a)The sum of 20 and -10 is less than 12.Show solution
Since , the statement is True.
Not sure why a step works? check your working in Super Tutor
3(b)`num3` is not more than 24.Show solution
So the expression is:
```python
num3 <= 24
```
This is True if `num3` is at most 24.
Not sure why a step works? check your working in Super Tutor
3(c)6.75 is between the values of integers num1 and num2.Show solution
```python
num1 < 6.75 < num2
```
This is True when `num1` is smaller than `6.75` and `num2` is larger than `6.75`.
Not sure why a step works? check your working in Super Tutor
3(d)The string 'middle' is larger than the string 'first' and smaller than the string 'last'.Show solution
```python
'middle' > 'first' and 'middle' < 'last'
```
This evaluates to True.
Not sure why a step works? check your working in Super Tutor
3(e)List Stationery is empty.Show solution
Not sure why a step works? check your working in Super Tutor
4(a)Add a pair of parentheses to each expression so that it evaluates to True.Show solution
```python
(0 == 1) == 2
```
This is not the intended True form, so a correct way is to group as:
```python
0 == (1 == 2)
```
But this still is not True. From the chapter’s idea of using parentheses to override precedence, the expression that can be made True is:
```python
(0 == 1) == 2
```
However, this evaluates to False.
So this particular item cannot be made True by adding only one pair of parentheses without changing the expression itself.
Not sure why a step works? check your working in Super Tutor
4(b)Add a pair of parentheses to each expression so that it evaluates to True.Show solution
```python
(2 + 3) == (4 + 5) == 7
```
But this evaluates to False because is false.
So with the expression exactly as given, it cannot be made True just by adding one pair of parentheses.
Not sure why a step works? check your working in Super Tutor
4(c)Add a pair of parentheses to each expression so that it evaluates to True.Show solution
```python
1 < (-1 == 3) > 4
```
This is not True, because `-1 == 3` is False.
The chapter’s rule about parentheses overrides precedence, but this expression still cannot be made True without changing the values/operators.
Not sure why a step works? check your working in Super Tutor
5(a)Write the output of the following:Show solution
- `num1 = 4`
- `num2 = num1 + 1 = 4 + 1 = 5`
- `num1 = 2`
- `print(num1, num2)` prints the current values of `num1` and `num2`.
So the output is:
```python
4 5
```
Not sure why a step works? check your working in Super Tutor
5(b)Write the output of the following:Show solution
- Initially, `num1, num2 = 2, 6`
- Then `num1, num2 = num2, num1 + 2`
- So `num1 = 6` and `num2 = 2 + 2 = 4`
- `print(num1, num2)` displays them.
Output:
```python
6 4
```
Not sure why a step works? check your working in Super Tutor
5(c)Write the output of the following:Show solution
So the program does not produce output; it raises an error for using an uninitialized variable.
Not sure why a step works? check your working in Super Tutor
6(a)Which data type will be used to represent the following data values and why?Show solution
Not sure why a step works? check your working in Super Tutor
6(b)Which data type will be used to represent the following data values and why?Show solution
Not sure why a step works? check your working in Super Tutor
6(c)Which data type will be used to represent the following data values and why?Show solution
Not sure why a step works? check your working in Super Tutor
6(d)Which data type will be used to represent the following data values and why?Show solution
Not sure why a step works? check your working in Super Tutor
6(e)Which data type will be used to represent the following data values and why?Show solution
Not sure why a step works? check your working in Super Tutor
6(f)Which data type will be used to represent the following data values and why?Show solution
Not sure why a step works? check your working in Super Tutor
6(g)Which data type will be used to represent the following data values and why?Show solution
Not sure why a step works? check your working in Super Tutor
6(h)Which data type will be used to represent the following data values and why?Show solution
Not sure why a step works? check your working in Super Tutor
7(a)Give the output of the following when num1 = 4, num2 = 3, num3 = 2Show solution
- `num1 += num2 + num3`
- `num1 = 4`, `num2 = 3`, `num3 = 2`
- First calculate the right side:
- Then add to `num1`:
So `num1` becomes `9` and is printed.
Not sure why a step works? check your working in Super Tutor
7(b)Give the output of the following when num1 = 4, num2 = 3, num3 = 2Show solution
- `num1 = num1 ** (num2 + num3)`
- First calculate the exponent:
- Then compute:
But the question set says this item is from the same group of outputs, and the textbook expression for this line is exactly `num1 = num1 ** (num2 + num3)`, which gives `1024` when `num1 = 4`.
Not sure why a step works? check your working in Super Tutor
7(c)Give the output of the following when num1 = 4, num2 = 3, num3 = 2Show solution
Not sure why a step works? check your working in Super Tutor
error or runtime error:
error or runtime error:
hanging on are represented using a two-dimensional
coordinate system, with the board's center at
coordinate (0,0). Variables x and y store the
x-coordinate and the y-coordinate of a dart that
hits the dartboard. Write a Python expression using
variables x and y that evaluates to True if the dart
hits (is within) the dartboard, and then evaluate the
expression for these dart coordinates:
hanging on are represented using a two-dimensional
coordinate system, with the board's center at
coordinate (0,0). Variables x and y store the
x-coordinate and the y-coordinate of a dart that
hits the dartboard. Write a Python expression using
variables x and y that evaluates to True if the dart
hits (is within) the dartboard, and then evaluate the
expression for these dart coordinates:
degree Celsius to degree Fahrenheit. If water boils
at 100 degree C and freezes as 0 degree C, use the
program to find out what is the boiling point and
freezing point of water on the Fahrenheit scale.
(Hint: T(°F) = T(°C) × 9/5 + 32)
payable if money has been lent on simple interest.
Principal or money lent = P, Rate of interest = R% per annum and Time = T years. Then Simple Interest (SI) = (P x R x T)/ 100.
Amount payable = Principal + SI.
P, R and T are given as input to the program.
27 more solved questions in Getting Started with Python
Every remaining exercise is solved step by step in Super Tutor, plus practice quizzes and flashcards for this chapter. Free to start.
Stuck on a step?
Ask Super Tutor AI to explain any solution on this page in a simpler way — free, 24x7.
Ask a Doubt FreeFrequently Asked Questions
What are the important topics in Getting Started with Python for CBSE Class 11 Computer Science?
How to score full marks in Getting Started with Python — CBSE Class 11 Computer Science?
Where can I get free NCERT Solutions for Getting Started with Python Class 11 Computer Science?
Sources & Official References
- NCERT Official — ncert.nic.in
- CBSE Academic — cbseacademic.nic.in
- CBSE Official — cbse.gov.in
- National Education Policy 2020 — education.gov.in
Content is aligned to the official syllabus. Refer to the board website for the latest curriculum.
More resources for Getting Started with Python
Practice Quiz
Test yourself with a quick quiz
Important Questions
Practice with board exam-style questions
Revision Notes
Key points for last-minute revision
Formula Sheet
All formulas in one place
Chapter Summary
Understand the chapter at a glance
Concept Maps
See how topics connect visually
Study Plan
Step-by-step plan to ace this chapter
Flashcards
Quick-fire cards for active recall
Syllabus
What topics to cover
For serious students
Get the full Getting Started with Python chapter — for free.
Quizzes, flashcards, AI doubt-solver and a step-by-step study plan for CBSE Class 11 Computer Science.