English

NCERT solutions for Computer Science [English] Class 11 chapter 8 - Strings [Latest edition]

Advertisements

Chapters

NCERT solutions for Computer Science [English] Class 11 chapter 8 - Strings - Shaalaa.com
Advertisements

Solutions for Chapter 8: Strings

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


Exercise
Exercise [Pages 187 - 188]

NCERT solutions for Computer Science [English] Class 11 8 Strings Exercise [Pages 187 - 188]

Exercise | Q 1. i. | Page 187

Consider the following string mySubject:

mySubject = "Computer Science"

What will be the output of the following string operation:

print(mySubject[0: len(mySubject)])

Exercise | Q 1. ii. | Page 187

Consider the following string mySubject:

mySubject = "Computer Science"

What will be the output of the following string operation:

print(mySubject[-7: -1])

Exercise | Q 1. iii. | Page 187

Consider the following string mySubject:

mySubject = "Computer Science"

What will be the output of the following string operation:

print(mySubject[::2])

Exercise | Q 1. iv. | Page 187

Consider the following string mySubject:

mySubject = "Computer Science"

What will be the output of the following string operation:

print(mySubject[len(mySubject) -1])

Exercise | Q 1. v. | Page 187

Consider the following string mySubject:

mySubject = "Computer Science"

What will be the output of the following string operation:

print(2*mySubject)

Exercise | Q 1. vi. | Page 187

Consider the following string mySubject:

mySubject = "Computer Science"

What will be the output of the following string operation:

print(mySubject[:: -2])

Exercise | Q 1. vii. | Page 187

Consider the following string mySubject:

mySubject = "Computer Science"

What will be the output of the following string operation:

print(mySubject[:3] + mySubject[3:])

Exercise | Q 1. viii. | Page 187

Consider the following string mySubject:

mySubject = "Computer Science"

What will be the output of the following string operation:

print(mySubject.swapcase())

Exercise | Q 1. ix. | Page 187

Consider the following string mySubject:

mySubject = "Computer Science"

What will be the output of the following string operation:

print(mySubject.startswith('Comp'))

Exercise | Q 1. x. | Page 187

Consider the following string mySubject:

mySubject = "Computer Science"

What will be the output of the following string operation:

print(mySubject.isalpha())

Exercise | Q 2. i. | Page 187

Consider the following string myAddress:

myAddress = "WZ-1, New Ganga Nagar, New Delhi"

What will be the output of the following string operation:

print(myAddress.lower())

Exercise | Q 2. ii. | Page 188

Consider the following string myAddress:

myAddress = "WZ-1, New Ganga Nagar, New Delhi"

What will be the output of the following string operation:

print(myAddress.upper())

Exercise | Q 2. iii. | Page 188

Consider the following string myAddress:

myAddress = "WZ-1, New Ganga Nagar, New Delhi"

What will be the output of the following string operation:

print(myAddress.count('New'))

Exercise | Q 2. iv. | Page 188

Consider the following string myAddress:

myAddress = "WZ-1, New Ganga Nagar, New Delhi"

What will be the output of the following string operation:

print(myAddress.find('New'))

Exercise | Q 2. v. | Page 188

Consider the following string myAddress:

myAddress = "WZ-1, New Ganga Nagar, New Delhi"

What will be the output of the following string operation:

print(myAddress.rfind('New'))

Exercise | Q 2. vi. | Page 188

Consider the following string myAddress:

myAddress = "WZ-1, New Ganga Nagar, New Delhi"

What will be the output of the following string operation:

print(myAddress.split(','))

Exercise | Q 2. vii. | Page 188

Consider the following string myAddress:

myAddress = "WZ-1, New Ganga Nagar, New Delhi"

What will be the output of the following string operation:

print(myAddress.split(' '))

Exercise | Q 2. viii. | Page 188

Consider the following string myAddress:

myAddress = "WZ-1, New Ganga Nagar, New Delhi"

What will be the output of the following string operation:

print(myAddress.replace('New', 'Old'))

Exercise | Q 2. ix. | Page 188

Consider the following string myAddress:

myAddress = "WZ-1, New Ganga Nagar, New Delhi"

What will be the output of the following string operation:

print(myAddress.partition(','))

Exercise | Q 2. x. | Page 188

Consider the following string myAddress:

myAddress = "WZ-1, New Ganga Nagar, New Delhi"

What will be the output of the following string operation:

print(myAddress.index('Agra'))

Programming Problems

Exercise | Q 1. | Page 188

Write a program to input line(s) of text from the user until enter is pressed. Count the total number of characters in the text (including white spaces), the total number of alphabets, the total number of digits, the total number of special symbols, and the total number of words in the given text. (Assume that each word is separated by one space).

Exercise | Q 2. | Page 188

Write a user-defined function to convert a string with more than one word into a title case string where the string is passed as a parameter. (Title case means that the first letter of each word is capitalized).

Exercise | Q 3. | Page 188

Write a function deleteChar() which takes two parameters one is a string and the other is a character. The function should create a new string after deleting all occurrences of the character from the string and return the new string.

Exercise | Q 4. | Page 188

Input a string having some digits. Write a function to return the sum of digits present in this string.

Exercise | Q 5. | Page 188

Write a function that takes a sentence as an input parameter where each word in the sentence is separated by a space. The function should replace each blank with a hyphen and then return the modified sentence.

Solutions for 8: Strings

Exercise
NCERT solutions for Computer Science [English] Class 11 chapter 8 - Strings - Shaalaa.com

NCERT solutions for Computer Science [English] Class 11 chapter 8 - Strings

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 8 (Strings) 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 8 Strings are Introduction to Strings, String, String Operators, Traversing a String, Built-in String Functions, String Handling.

Using NCERT Computer Science [English] Class 11 solutions Strings 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 8, Strings 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×