English

NCERT solutions for Computer Science [English] Class 11 chapter 5 - Getting Started with Python [Latest edition]

Advertisements

Chapters

NCERT solutions for Computer Science [English] Class 11 chapter 5 - Getting Started with Python - Shaalaa.com
Advertisements

Solutions for Chapter 5: Getting Started with Python

Below listed, you can find solutions for Chapter 5 of CBSE NCERT for Computer Science [English] Class 11.


Exercise
Exercise [Pages 115 - 119]

NCERT solutions for Computer Science [English] Class 11 5 Getting Started with Python Exercise [Pages 115 - 119]

Exercise | Q 1. i | Page 115

Which of the following identifier name are invalid and why?

Serial_no

  • Valid

  • Invalid

Exercise | Q 1. ii | Page 115

Which of the following identifier name are invalid and why?

1st_Room

  • Valid

  • Invalid

Exercise | Q 1. iii | Page 115

Which of the following identifier name are invalid and why?

Hundred$

  • Invalid

  • Valid

Exercise | Q 1. iv | Page 115

Which of the following identifier name are invalid and why?

Total Marks

  • Invalid

  • Valid

Exercise | Q 1. v | Page 115

Which of the following identifier name are invalid and why?

Total_Marks

  • Invalid

  • Valid

Exercise | Q 1. vi | Page 115

Which of the following identifier name are invalid and why?

total-Marks

  • Invalid

  • Valid

Exercise | Q 1. vii | Page 115

Which of the following identifier name are invalid and why?

_Percentage

  • Invalid

  • Valid

Exercise | Q 1. viii | Page 115

Which of the following identifier name are invalid and why?

True

  • Invalid

  • Valid

Exercise | Q 2. a) | Page 115

Write the corresponding Python assignment statement:

Assign 10 to variable length and 20 to variable breadth.

Exercise | Q 2. b) | Page 115

Write the corresponding Python assignment statement:

Assign the average of values of the variable's length and breadth to a variable sum.

Exercise | Q 2. c) | Page 115

Write the corresponding Python assignment statement:

Assign a list containing strings ‘Paper’, ‘Gel Pen’, and ‘Eraser’ to variable stationery.

Exercise | Q 2. d) | Page 115

Write the corresponding Python assignment statement:

Assign the strings ‘Mohandas’, ‘Karamchand’, and ‘Gandhi’ to variables first, middle and last.

Exercise | Q 2. e) | Page 115

Write the corresponding Python assignment statement:

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.

Exercise | Q 3. a) | Page 115

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

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

Exercise | Q 3. b) | Page 115

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

num3 is not more than 24.

Exercise | Q 3. c) | Page 116

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

6.75 is between the values of integers num1 and num2.

Exercise | Q 3. d) | Page 116

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

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

Exercise | Q 3. e) | Page 116

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

List Stationery is empty.

Exercise | Q 4. a) | Page 116

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

0 == 1 == 2

Exercise | Q 4. b) | Page 116

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

2 + 3 == 4 + 5 == 7

Exercise | Q 4. c) | Page 116

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

1 < -1 == 3 > 4

Exercise | Q 5. a) | Page 116

Write the output of the following:

num1 = 4
num2 = num1 + 1
num1 = 2
print (num1, num2)
Exercise | Q 5. b) | Page 116

Write the output of the following:

num1, num2 = 2, 6
num1, num2 = num2, num1 + 2
print (num1, num2)
Exercise | Q 5. c) | Page 116

Write the output of the following:

num1, num2 = 2, 3
num3, num2 = num1, num3 + 1
print (num1, num2, num3)
Exercise | Q 6. a) | Page 116

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

Number of months in a year

Exercise | Q 6. b) | Page 116

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

A resident of Delhi or not

Exercise | Q 6. c) | Page 116

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

Mobile number

Exercise | Q 6. d) | Page 116

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

Pocket money

Exercise | Q 6. (e) | Page 116

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

Volume of a sphere

Exercise | Q 6. f) | Page 116

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

Perimeter of a square

Exercise | Q 6. g) | Page 116

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

Name of the student

Exercise | Q 6. h) | Page 116

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

Address of the student

Exercise | Q 7. a) | Page 116

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

num1 += num2 + num3
print (num1)

Exercise | Q 7. b) | Page 116

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

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

Exercise | Q 7. c) | Page 116

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

num1 **= num2 + num3

Exercise | Q 7. d) | Page 116

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

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

Exercise | Q 7. e) | Page 117

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

print(4.00 / (2.0 + 2.0))

Exercise | Q 7. f) | Page 117

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

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

Exercise | Q 7. g) | Page 117

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

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

Exercise | Q 7. h) | Page 117

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

num1 = float(10)
print (num1)

Exercise | Q 7. i) | Page 117

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

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

Exercise | Q 7. j) | Page 117

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

print('Bye' == 'BYE')

Exercise | Q 7. k) | Page 117

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

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

Exercise | Q 7. l) | Page 117

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

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

Exercise | Q 7. m) | Page 117

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

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

Exercise | Q 7. n) | Page 117

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

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

Exercise | Q 8. a) | Page 117

Categorize the following as syntax error, logical error, or runtime error:

25 / 0

  • Syntax error

  • Logical error

  • Runtime error

Exercise | Q 8. b) | Page 117

Categorize the following as syntax error, logical error, or runtime error:

num1 = 25; num2 = 0; num1/num2

  • Syntax error

  • Logical error

  • Runtime error

Exercise | Q 9. | Page 117

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

  1. (0, 0)
  2. (10, 10)
  3. (6, 6)
  4. (7, 8)
Exercise | Q 10. | Page 117

Write a Python program to convert temperature in degrees Celsius to degrees Fahrenheit. If the water boils at 100 degrees C and freezes at 0 degrees 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)

Exercise | Q 11. | Page 117

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 × R × T)/100.

Amount payable = Principal + SI.

P, R, and T are given as input to the program.

Exercise | Q 12. | Page 118

Write a program to calculate how many days of work will be completed by three people A, B, and C together. A, B, and 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.

Exercise | Q 13. | Page 118

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

Exercise | Q 14. | Page 118

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

Exercise | Q 15. | Page 118

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

Exercise | Q 16. | Page 118

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

Exercise | Q 17. | Page 118

Write a program to find the average of three numbers.

Exercise | Q 18. | Page 118

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

Exercise | Q 19. | Page 118

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.

Exercise | Q 20. | Page 118

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.

Exercise | Q 21. | Page 118

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:

  1. 16 feet and 75 degrees
  2. 20 feet and 0 degrees
  3. 24 feet and 45 degrees
  4. 24 feet and 80 degrees

CASE STUDY-BASED QUESTION

Exercise | Q 1 | Page 119

Schools use the “Student Management Information System” (SMIS) to manage student-related data. This system provides facilities for:

  • recording and maintaining the personal details of students.
  • maintaining marks scored in assessments and computing results of students.
  • keeping track of student attendance.
  • managing many other student-related data. Let us automate this process step by step.

Identify the personal details of students from your school identity card and write a program to accept these details for all students of your school and display them in the following format.

Name of 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: 9999999999999

Solutions for 5: Getting Started with Python

Exercise
NCERT solutions for Computer Science [English] Class 11 chapter 5 - Getting Started with Python - Shaalaa.com

NCERT solutions for Computer Science [English] Class 11 chapter 5 - Getting Started with Python

Shaalaa.com has the CBSE Mathematics Computer Science [English] Class 11 CBSE solutions in a manner that help students grasp basic concepts better and faster. The detailed, step-by-step solutions will help you understand the concepts better and clarify any confusion. NCERT solutions for Mathematics Computer Science [English] Class 11 CBSE 5 (Getting Started with Python) include all questions with answers and detailed explanations. This will clear students' doubts about questions and improve their application skills while preparing for board exams.

Further, we at Shaalaa.com provide such solutions so students can prepare for written exams. NCERT textbook solutions can be a core help for self-study and provide excellent self-help guidance for students.

Concepts covered in Computer Science [English] Class 11 chapter 5 Getting Started with Python are Introduction to Python, Key Features of Python, Working with Python, Execution Modes, Python Keywords, Identifiers, Variables, Comments, Everything is an Object, Python Data Types, Number, Sequence, Set, None, Mapping, Classification of Data Types, Deciding Usage of Python Data Types, Operators in Python, Operators - Arithmetic Operators (-,+,*,/,%), Relational Operator (>,>=,<=,=,!=), Assignment Operators, Logical Operators (!,&&,||), Identity Operators, Membership Operators, Statement, Input and Output, Expressions, Type Conversion, Explicit Conversion, Implicit Conversion, Debugging.

Using NCERT Computer Science [English] Class 11 solutions Getting Started with Python exercise by students is an easy way to prepare for the exams, as they involve solutions arranged chapter-wise and also page-wise. The questions involved in NCERT Solutions are essential questions that can be asked in the final exam. Maximum CBSE Computer Science [English] Class 11 students prefer NCERT Textbook Solutions to score more in exams.

Get the free view of Chapter 5, Getting Started with Python Computer Science [English] Class 11 additional questions for Mathematics Computer Science [English] Class 11 CBSE, and you can use Shaalaa.com to keep it handy for your exam preparation.

Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×