0% found this document useful (0 votes)
7 views2 pages

String Worksheet

This document is a revision worksheet for Grade XI Computer Science focusing on string manipulation in Python. It includes a variety of programming tasks and questions that require students to write code and analyze string outputs. The worksheet is divided into two sections, with Section A containing specific coding outputs and Section B consisting of programming exercises.

Uploaded by

devilmansenpai
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

String Worksheet

This document is a revision worksheet for Grade XI Computer Science focusing on string manipulation in Python. It includes a variety of programming tasks and questions that require students to write code and analyze string outputs. The worksheet is divided into two sections, with Section A containing specific coding outputs and Section B consisting of programming exercises.

Uploaded by

devilmansenpai
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

NATIONAL CENTRE FOR EXCELLENCE

BENGALURU
REVISION WORKSHEET ON STRING-2025-26
SUBJECT: COMPUTER SCIENCE (083)
GRADE: XI
TIME: 40 MINUTES​ ​ ​ ​ ​ MAXIMUM MARKS: 20

Q. SECTION A
No
Write the output:
1 print('ba'+'na'*2)
2 s='Welcome to [Link]'
print( [Link]('com',8,30))
print([Link]('come'))
3 s='Hello'
for i in s:
print(i,end='#')
5 a='hello'
b='virat'
for i in range(len(a)):
print(a[i],b[i])
6 print(“hello”+1+2+3)
7 str = "my subject is python”
print ([Link]())
print([Link]())
print([Link]()
8 a = "Mahender Singh Dhoni"
a = [Link]()
b = a[0][0]+". "+a[1][0]+". "+a[2]
print (b)
9 s='Mahender, Singh, Dhoni'
s1=[Link]()
for i in s1:
print(i)
10 line = "PYTHON IS EASY TO LEARN"
L = [Link]('a')
for i in L:
print(i, end=' ')
SECTION B
11 s="For Python"
n = len(s)
m=''
for i in range(0, n):
if (s[i] >= 'a' and s[i] <= 'm'):
m = m + s[i].upper()
elif (s[i] >= 'n' and s[i] <= 'z'):
m = m + s[i-1]
elif (s[i].isupper()):
m = m + s[i].lower()
else:
m = m + '#'
print(m)
12 Write a Program to Take in a String and Replace Every Blank Space with Hyphen.
13 Write a Program to Calculate the Number of Words and the Number of Characters,
vowels, digits, spaces and special symbols Present in a String
14 Write a Program to Form a New String Made of the First 2 and Last 2 characters From
a Given String
15 Write a Program to Count the Occurrences of a Word in a given string sentence

You might also like