0% found this document useful (0 votes)
171 views3 pages

Winter Holiday Homework (CS)

The document contains 10 questions as part of a winter break holiday homework assignment for Class 11 Computer Science students. The questions cover topics like Python programming, including string manipulation, lists, sorting, and more. Students are asked to write Python code to perform tasks like replacing vowels in a string, reversing a string, counting words, sorting lists, retrieving data from nested lists, and differentiating between various Python functions.

Uploaded by

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

Winter Holiday Homework (CS)

The document contains 10 questions as part of a winter break holiday homework assignment for Class 11 Computer Science students. The questions cover topics like Python programming, including string manipulation, lists, sorting, and more. Students are asked to write Python code to perform tasks like replacing vowels in a string, reversing a string, counting words, sorting lists, retrieving data from nested lists, and differentiating between various Python functions.

Uploaded by

shravantyagi914
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

WINTER BREAK HOLIDAY HOMEWORK 2023-24

CLASS-XI COMPUTER SCIENCE

Q1. Write a program in python to input a string from the user and do the
following (separately)-
(i) Replace all the vowels with ‘x’.
(ii) Reverse the string.
(iii) Find the number of words in a sentence.
(iv) Count the number of words starting with ‘s’, irrespective of case
Q2.What are netiquettes?why are these important?
Q3.Consider the following list myList. What will be the elements of myList after
the following two operations:
myList = [10,20,30,40]

i. myList.append([50,60])
ii.myList.extend([80,90])

Q4.Write the output of the given python code :

(a) aList1 = [123, ‘xyz’, ‘zara’, ‘abc’];


print “A List:”, aList.pop()
print “B List:”, aList.pop(2)
(b) list1 = [12,32,65,26,80,10]
list1.sort()
print(list1)
(c) list1 = [12,32,65,26,80,10]
sorted(list1)
print(list1)
Q5.Write the output of the following code :
Text=”gmail@com”
L=len(Text)
ntext=””
for I in range(0,l):
if Text[i].isupper():
ntext=ntext+Text[i].lower()
elif Text[i].isalpha():
ntext=ntext+Text[i].upper()
else:
ntext=ntext+’bb’
print(ntext)

Q6. Write a program that reads a line, then counts words and displays how many
words are there in the
line.
Q7.Write a program to calculate and display the sum of all the odd numbers in
the list.

Q8.Write a program to read a list of n integers (positive as well as negative).


Create two new lists, one having all positive numbers and the other having all
negative numbers from the given list. Print all three lists.

Q9.The record of a student (Name, Roll No.,Marks in five subjects and


percentage of marks) is
stored in the following list:

stRecord = ['Raman','A-36',[56,98,99,72,69], 78.8]

Write Python statements to retrieve the following information from the list
stRecord.

a. Percentage of the student


b. Marks in the fifth subject
c. Maximum marks of the student
d. Roll no. of the student
e. Change the name of the student from ‘Raman’ to ‘Raghav’

Q10. Differentiate between the following pair of functions and cite examples for
each-

(i) chr ( ) and ord ( )


(ii) lower ( ) islower ( )
(iii) sort ( ) and sorted ( )
(iv) split ( ) and partition ( )
(v) append ( ) and entend ( )

You might also like