Courses
Courses for Kids
Free study material
Offline Centres
More
Store Icon
Store

NCERT Solutions For Class 11 Computer Science Chapter 5 Getting Started With Python - 2025-26

ffImage
banner

Exercise-wise Answers & Revision Tips for Getting Started With Python Class 11

Kickstart your coding journey with our NCERT Solutions for Class 11 Computer Science Chapter 5: Getting Started With Python. This easy-to-use guide covers every exercise, ensuring you understand Python basics clearly and can score higher in the CBSE 2025–26 exams.


Dive into stepwise answers, exam-ready definitions, and structured solutions that match the CBSE marking scheme. Whether you need thorough Computer Science Chapter 5 exercise solutions or quick chapter notes, you’ll find everything here—including tips for answering long questions and diagrams.


Download the free PDF for instant offline access and equip yourself for smarter revision. Developed by experienced teachers, these stepwise solutions are perfect for mastering Python concepts and boosting your exam confidence.


Exercise-wise Answers & Revision Tips for Getting Started With Python Class 11

question:

1. Which of the following identifier names are invalid and why?
i Serial_no. v Total_Marks
ii 1st_Room vi total-Marks
iii Hundred$
vii _Percentage
iv Total Marks 

viii True

answer:

  • Serial_no. — Invalid (dot . not allowed in identifiers).

  • 1st_Room — Invalid (cannot start with a digit).

  • Hundred$ — Invalid ($ not allowed in Python identifiers).

  • Total Marks — Invalid (spaces not allowed).

  • Total_Marks — Valid (letters + underscore).

  • total-Marks — Invalid (- is minus operator, not allowed in identifiers).

  • _Percentage — Valid (leading underscore is allowed).

  • True — Invalid (reserved boolean literal in Python).


question:

2. Write the corresponding Python assignment statements: 

a) Assign 10 to variable length and 20 to variable breadth. 

b) Assign the average of values of variables length and breadth to a variable sum. 

c) Assign a list containing strings ‘Paper’, ‘Gel Pen’, and ‘Eraser’ to a variable stationery. d) Assign the strings ‘Mohandas’, ‘Karamchand’, and ‘Gandhi’ to variables first, middle and last. 

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.


answer:

length = 10 breadth = 20

sum = (length + breadth) / 2

stationery = ['Paper', 'Gel Pen', 'Eraser']

first = 'Mohandas'
middle = 'Karamchand'
last = 'Gandhi'

fullname = first + ' ' + middle + ' ' + last


question:

3. Write logical expressions corresponding to the following statements in Python and evaluate the expressions (assuming variables num1, num2, num3, first, middle, last are already having meaningful values): 

a) The sum of 20 and –10 is less than 12. 

b) num3 is not more than 24. 

c) 6.75 is between the values of integers num1 and num2. 

d) The string ‘middle’ is larger than the string ‘first’ and smaller than the string ‘last’. 

e) List Stationery is empty.


answer:

  1. 20 + (-10) < 12 ⇒ True.

  2. num3 <= 24 ⇒ depends on value of num3.

  3. min(num1, num2) < 6.75 < max(num1, num2) ⇒ depends on num1, num2.

  4. ('middle' > 'first') and ('middle' < 'last') ⇒ False (since 'middle' < 'last' is False).

  5. not Stationery (or len(Stationery) == 0) ⇒ True if list is empty.


question:

4. Add a pair of parentheses to each expression so that it evaluates to True. 

a) 0 == 1 == 2 

b) 2 + 3 == 4 + 5 == 7 

c) 1 < -1 == 3 > 4


answer:

  1. 0 == (1 == 2) ⇒ 0 == False ⇒ True.

  2. No placement of a single pair of parentheses makes 2 + 3 == 4 + 5 == 7 True in Python.

  3. (1 < -1) == (3 > 4) ⇒ False == False ⇒ True.


question:

5. Write the output of the following: 

a) num1 = 4 num2 = num1 + 1 num1 = 2 print (num1, num2) 

b) num1, num2 = 2, 6 num1, num2 = num2, num1 + 2 print (num1, num2) 

c) num1, num2 = 2, 3 num3, num2 = num1, num3 + 1 print (num1, num2, num3)


answer:

  1. Output: 2 5

  2. Output: 6 4

  3. Raises NameError: name 'num3' is not defined (so no output).


question:

6. Which data type will be used to represent the following data values and why? 

a) Number of months in a year 

b) Resident of Delhi or not 

c) Mobile number 

d) Pocket money 

e) Volume of a sphere 

f) Perimeter of a square 

g) Name of the student 

h) Address of the student


answer:

  1. int — whole number, fixed count (12).

  2. bool — True/False.

  3. str — treated as text (leading zeros, no arithmetic).

  4. float (or Decimal for currency accuracy) — can have fractions.

  5. float — measurement may be fractional.

  6. float — may be fractional depending on side.

  7. str — text.

  8. str — multi-word text.


question:

7. Give the output of the following when num1 = 4, num2 = 3, num3 = 2 

a) num1 += num2 + num3 print (num1) 

b) num1 = num1 ** (num2 + num3) print (num1) 

c) num1 **= num2 + num3 

d) num1 = '5' + '5' print(num1) 

e) print(4.00/(2.0+2.0)) 

f) num1 = 2+9*((3*12)-8)/10 print(num1) 

g) num1 = 24 // 4 // 2 print(num1) 

h) num1 = float(10) print (num1) 

i) num1 = int('3.14') print (num1) 

j) print('Bye' == 'BYE') 

k) print(10 != 9 and 20 >= 20) 

l) print(10 + 6 * 2 ** 2 != 9//4 -3 and 29 >= 29/9) 

m) print(5 % 10 + 10 < 50 and 29 <= 29) 

n) print((0 < 6) or (not(10 == 6) and (10<0)))


answer:

  1. 9

  2. 1024

  3. No output; updates num1 to 1024.

  4. 55

  5. 1.0

  6. 27.2

  7. 3

  8. 10.0

  9. Raises ValueError: invalid literal for int() with base 10: '3.14'

  10. False

  11. True

  12. True

  13. True

  14. True


question:

8. Categorise the following as syntax error, logical error or runtime error: 

a) 25 / 0 

b) num1 = 25; num2 = 0; num1/num2


answer:

  1. Runtime error (ZeroDivisionError).

  2. Runtime error (ZeroDivisionError).


question:

9. A dartboard of radius 10 units and the wall it is 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: 

a) (0,0) 

b) (10,10) 

c) (6, 6) 

d) (7,8)


answer:

Expression: x**2 + y**2 <= 10**2

  1. (0,0) ⇒ 0 <= 100 ⇒ True

  2. (10,10) ⇒ 200 <= 100 ⇒ False

  3. (6,6) ⇒ 72 <= 100 ⇒ True

  4. (7,8) ⇒ 113 <= 100 ⇒ False


question:

10. Write a Python program to convert temperature in 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)


answer:

c = float(input("Enter °C: ")) f = c * 9/5 + 32 print("°F:", f)
Using the formula:
100°C → 212°F, 0°C → 32°F

Boiling point: 212°F   |   Freezing point: 32°F


question:

11. Write a Python program to calculate the amount 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.


answer:

P = float(input("Principal: ")) R = float(input("Rate (% per annum): ")) T = float(input("Time (years): ")) SI = (P * R * T) / 100 amount = P + SI print("Simple Interest:", SI) print("Amount Payable:", amount) 


question:

12. Write a program to calculate in how many days a work will be completed by three persons A, B and C together. A, B, C take x days, y days and z days respectively to do the job alone. The formula to calculate the number of days if they work together is xyz/(xy + yz + xz) days where x, y, and z are given as input to the program.


answer:

x = float(input("Days A takes: ")) y = float(input("Days B takes: ")) z = float(input("Days C takes: ")) days_together = (x * y * z) / (x * y + y * z + x * z) print("Days to finish together:", days_together) 


question:

13. Write a program to enter two integers and perform all arithmetic operations on them.


answer:

a = int(input("First integer: ")) b = int(input("Second integer: "))

print("Add:", a + b)
print("Sub:", a - b)
print("Mul:", a * b)
print("Div:", a / b) # true division
print("Floor Div:", a // b) # floor division
print("Mod:", a % b)
print("Pow:", a ** b)


question:

14. Write a program to swap two numbers using a third variable.


answer:

a = int(input("a: ")) b = int(input("b: ")) temp = a a = b b = temp print("a =", a, "b =", b) 


question:

15. Write a program to swap two numbers without using a third variable.


answer:

a = int(input("a: ")) b = int(input("b: ")) a, b = b, a print("a =", a, "b =", b) 


question:

16. Write a program to repeat the string ‘‘GOOD MORNING” n times. Here ‘n’ is an integer entered by the user.


answer:

n = int(input("n: ")) for _ in range(n): print("GOOD MORNING") 


question:

17. Write a program to find average of three numbers.


answer:

a = float(input("a: ")) b = float(input("b: ")) c = float(input("c: ")) avg = (a + b + c) / 3 print("Average:", avg) 


question:

18. The volume of a sphere with radius r is 4/3πr3. Write a Python program to find the volume of spheres with radius 7cm, 12cm, 16cm, respectively.


answer:

import math

for r in (7, 12, 16):
V = (4/3) * math.pi * (r ** 3)
print(f"r = {r} cm → Volume = {V:.2f} cm³")

Results:
r=7 → 1436.76 cm³
r=12 → 7238.23 cm³
r=16 → 17157.28 cm³

question:

19. Write a program that asks the user to enter their name and age. Print a message addressed to the user that tells the user the year in which they will turn 100 years old.


answer:

from datetime import date name = input("Name: ") age = int(input("Age: ")) current_year = date.today().year turn_100_year = current_year + (100 - age) print(f"Hello {name}, you will turn 100 in the year {turn_100_year}.") 


question:

20. The formula E = mc2 states that the equivalent energy (E) can be calculated as the mass (m) multiplied by the speed of light (c = about 3×108 m/s) squared. Write a program that accepts the mass of an object and determines its energy.


answer:

m = float(input("Mass (kg): ")) c = 3e8 E = m * c * c print("Energy (Joules):", E) 


question:

21. Presume that a ladder is put upright against a wall. Let variables length and angle store the length of the ladder and the angle that it forms with the ground as it leans against the wall. Write a Python program to compute the height reached by the ladder on the wall for the following values of length and angle: 

a) 16 feet and 75 degrees 

b) 20 feet and 0 degrees 

c) 24 feet and 45 degrees 

d) 24 feet and 80 degrees


answer:

import math

def height(length, angle_degrees):
return length * math.sin(math.radians(angle_degrees))

cases = [(16, 75), (20, 0), (24, 45), (24, 80)]
for L, A in cases:
print(f"L={L} ft, A={A}° → height = {height(L, A):.2f} ft")

Results:
16 ft @ 75° → 15.45 ft
20 ft @ 0° → 0.00 ft
24 ft @ 45° → 16.97 ft
24 ft @ 80° → 23.64 ft

Case Study-based Question
1. Schools use a Student Management Information System (SMIS) to manage student-related data.
This system provides facilities for:

  • Recording and maintaining personal details of students.

  • Maintaining marks scored in assessments and computing results.

  • Keeping track of student attendance.

  • Managing other student-related data.

Let us automate this process step by step.

Task:
Identify the personal details of students from your school identity card and write a Python program to:

  1. Accept these details for all students of your school.

  2. Display the details in the following format:

    personal details of students



Answer:
# Program to accept and display student details


school_name = input("Enter School Name: ")

student_name = input("Enter Student Name: ")

roll_no = input("Enter Roll Number: ")

student_class = input("Enter Class: ")

section = input("Enter Section: ")

address1 = input("Enter Address Line 1: ")

address2 = input("Enter Address Line 2: ")

city = input("Enter City: ")

pincode = input("Enter Pin Code: ")

contact = input("Enter Parent's/Guardian's Contact No: ")


print("\n" + school_name.center(60))

print()

print(f"Student Name: {student_name:<20} Roll No: {roll_no}")

print(f"Class: {student_class:<26} Section: {section}")

print(f"Address :  {address1}")

print(f"           {address2}")

print()

print(f"City: {city:<25} Pin Code: {pincode}")

print(f"Parent’s/ Guardian’s Contact No: {contact}")

Sample Output:

                 

ABC Public School


Student Name: PQR            Roll No: 99

Class: XI                    Section: A

Address :  Address Line 1 Address Line 2

City: ABC                    Pin Code: 999999

Parent’s/ Guardian’s Contact No: 9999999999


Getting Started with Python: Concepts and Tips

Explore the basics of Python programming from Class 11 NCERT with step-by-step explanations. Mastering Python variables, data types, and operators is essential for building a strong foundation in Computer Science for the 2025-26 syllabus.


With clear solutions for all important topics—keywords, identifiers, input/output, and debugging techniques—students can quickly resolve doubts and strengthen understanding. Keep practicing code examples to boost your exam preparation!


Regular revision and attempting exercise-based Python questions will make you confident for Computer Science exams. Use this chapter’s structured answers to sharpen your concepts and maximize your NCERT Class 11 score.


CBSE Class 11 Computer Science Chapter-wise NCERT Solutions



CBSE Class 11 Computer Science Study Materials

FAQs on NCERT Solutions For Class 11 Computer Science Chapter 5 Getting Started With Python - 2025-26

1. What are NCERT Solutions for Class 11 Computer Science Chapter 5: Getting Started With Python?

NCERT Solutions for Class 11 Computer Science Chapter 5: Getting Started With Python provide step-by-step answers to all textbook exercises, helping students master Python basics. Key features include:

  • Complete exercise-wise solutions for intext and back questions
  • Teacher-reviewed for accuracy and CBSE alignment
  • Stepwise method for easy marks in exams
  • Available as free downloadable PDF for offline study
These solutions are essential for building a strong programming foundation and scoring high in school exams.

2. How can I download the PDF of NCERT Solutions for Computer Science Chapter 5 Class 11?

You can download the NCERT Solutions PDF for Class 11 Computer Science Chapter 5 directly from trusted educational platforms. Steps include:

  • Locate the Download PDF button on the solutions page
  • Click and save the PDF for instant offline access
  • The file contains stepwise answers, diagrams, and marking tips
This ensures you always have a reliable reference for revisions and exam practice.

3. Are diagrams and definitions mandatory when answering CBSE Class 11 Computer Science Chapter 5 questions?

Including definitions and diagrams in your answers can help you score full marks, as they match CBSE guidelines and marking schemes. Best practices are:

  • Write clear definitions for all key terms
  • Neatly label relevant diagrams or flowcharts when asked
  • Use bullet points and stepwise explanation where appropriate
This approach enhances clarity and shows deep conceptual understanding.

4. What are the most important topics covered in NCERT Class 11 Computer Science Chapter 5: Getting Started With Python?

The key topics in Chapter 5 include:

  • Introduction to Python and its features
  • Basic Python syntax and rules
  • Coding simple programs and expressions
  • Understanding identifiers, keywords, variables
  • Working with input/output functions
Focusing on these concepts builds a strong programming foundation for higher classes and CBSE exams.

5. How should I structure long answers for Class 11 Computer Science Chapter 5 to score maximum marks?

To score maximum marks for long answer questions in Chapter 5, follow these tips:

  • Start with a clear introduction and definition
  • List steps or points in sequence
  • Include code snippets/diagrams where relevant
  • Conclude with a short summary
This structure matches the CBSE marking scheme and helps you get credit for every point.

6. Are NCERT Solutions enough for Class 11 Computer Science exam preparation?

NCERT Solutions are comprehensive for CBSE exams as they:

  • Cover all intext and exercise questions
  • Follow the NCERT and CBSE syllabus 2025-26
  • Provide stepwise methods for clear understanding
For higher scores, also refer to exemplar problems and practice sample papers along with NCERT Solutions.

7. What is the best way to revise Getting Started With Python (Class 11 Computer Science) before exams?

The most efficient revision plan for Chapter 5 includes:

  • Reviewing all definitions and key formulae
  • Practicing coding questions and their stepwise solutions
  • Going through diagrams and labelled examples
  • Using flash notes and summary tables for quick recall
Follow a 1-day, 3-day, and 7-day revision planner to consolidate learning quickly.

8. Do examiners award partial marks for correct steps even if the final coding answer is wrong in Computer Science Chapter 5?

Yes, CBSE examiners often give partial (step) marks for correct steps or logic, even if the final answer has minor errors. To maximise marks:

  • Show all reasoning and intermediate steps clearly
  • Avoid leaving answers blank
  • Use labels and comments in code as per marking scheme
This approach ensures you get marks for your understanding, not just the final output.

9. How can I avoid common mistakes in Class 11 Computer Science Chapter 5 answers?

To avoid frequent errors in Chapter 5 responses:

  • Use correct syntax and indentation in Python code
  • Read questions carefully for keywords and tasks
  • Don’t skip definitions or diagrams where required
  • Write neat, stepwise answers matching NCERT format
Paying attention to these details helps you score better and avoid negative marking.

10. Where can I find chapterwise solutions and important questions for Class 11 Computer Science?

You can access chapterwise NCERT Solutions and important questions for Class 11 Computer Science on reputable study platforms. These resources offer:

  • Exercise-wise and chapterwise solutions in PDF format
  • Collections of likely exam questions for practice
  • Revision notes, MCQs, and sample papers for thorough preparation
This ensures comprehensive coverage for CBSE 2025-26 exams.