Strings
CBSE · Class 11 · Computer Science
NCERT Solutions for Strings — CBSE Class 11 Computer Science.
Interactive on Super Tutor
Studying Strings? 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
4 worked solutions below. Unlock all 7 free in Super Tutor
EXERCISE
1Consider the following string mySubject:
mySubject = "Computer Science"
What will be the output of the following string operations :Show solution
ii. `Scien`
iii. `Cmue cc`
iv. `e`
v. `Computer ScienceComputer Science`
vi. `ecneiS retupmoC`
vii. `Computer Science`
viii. `cOMPUTER sCIENCE`
ix. `True`
x. `False`
Not sure why a step works? check your working in Super Tutor
2Consider the following string myAddress:
myAddress = "WZ-1,New Ganga Nagar,New Delhi"
What will be the output of following string operations :Show solution
ii. `WZ-1,NEW GANGA NAGAR,NEW DELHI`
iii. `2`
iv. `5`
v. `21`
vi. `['WZ-1', 'New Ganga Nagar', 'New Delhi']`
vii. The book text appears to have a printing error in `split(' '')`. Interpreting it as splitting by space, the output is `['WZ-1,New', 'Ganga', 'Nagar,New', 'Delhi']`.
viii. `WZ-1,Old Ganga Nagar,Old Delhi`
ix. `('WZ-1', ',', 'New Ganga Nagar,New Delhi')`
x. `ValueError: substring not found`
Not sure why a step works? check your working in Super Tutor
PROGRAMMING PROBLEMS
1Write 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), total number of alphabets, total number of digits, total number of special symbols and total number of words in the given text. (Assume that each word is separated by one space).Show solution
text = input("Enter text: ")
chars = len(text)
alphabets = 0
digits = 0
special = 0
words = 0
for ch in text:
if ch.isalpha():
alphabets += 1
elif ch.isdigit():
digits += 1
elif ch != ' ':
special += 1
if text != '':
words = text.count(' ') + 1
print("Total characters:", chars)
print("Total alphabets:", alphabets)
print("Total digits:", digits)
print("Total special symbols:", special)
print("Total words:", words)
```
Not sure why a step works? check your working in Super Tutor
2Write a user defined function to convert a string with more than one word into title case string where string is passed as parameter. (Title case means that the first letter of each word is capitalised)Show solution
def titleCase(st):
newstr = ''
word = ''
for ch in st:
if ch == ' ':
newstr += word.capitalize() + ' '
word = ''
else:
word += ch
newstr += word.capitalize()
return newstr
st = input("Enter a string: ")
print(titleCase(st))
```
Not sure why a step works? check your working in Super Tutor
3 more solved questions in Strings
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 Strings for CBSE Class 11 Computer Science?
How to score full marks in Strings — CBSE Class 11 Computer Science?
Where can I get free NCERT Solutions for Strings 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 Strings
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 Strings chapter — for free.
Quizzes, flashcards, AI doubt-solver and a step-by-step study plan for CBSE Class 11 Computer Science.