0% found this document useful (0 votes)
12 views1 page

Winter Holidays Home Work Class XI CS

The document outlines winter break homework for Class XI Computer Science at PM SHRI Kendriya Vidyalaya No.1 Bathinda Cantt. It includes various Python programming tasks such as manipulating lists, finding maximum values, and calculating averages. Students are required to complete exercises involving string manipulation, list operations, and dictionary usage.

Uploaded by

vedipaaji
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)
12 views1 page

Winter Holidays Home Work Class XI CS

The document outlines winter break homework for Class XI Computer Science at PM SHRI Kendriya Vidyalaya No.1 Bathinda Cantt. It includes various Python programming tasks such as manipulating lists, finding maximum values, and calculating averages. Students are required to complete exercises involving string manipulation, list operations, and dictionary usage.

Uploaded by

vedipaaji
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/ 1

PM SHRI KENDRIYA VIDYALAYA NO.1 BATHINDA CANTT.

WINTER BREAK HOLIDAY HOME WORK- 2024-25


CLASS-XI(COMPUTER SCIENCE)
Given a Python Code Snippet Your Computer Science teacher has created a list :-
str = input("Enter the string: ") L =
length = len(str) [150,50,99,73,14,10,22,46,3,10,60,50,10]
for a in range(0, length, 2): She wants you to use the Built in Methods of List to find the
print(str[a:a+2])
following tasks:-
What will be the output if the entered
i. Find the number of times 10 is written in the List L
string is “India is Beautiful”.
ii. Find the Maximum Number from the List L
iii. Add all the numbers in the List and Print the total
iv. Arrange the List in Ascending Order.
v. Delete the first occurrence of 50 in the List.
Write a python program that takes a string as an What will be the ouput when following expression be
input and prints a list containing length of each evaluated in Python?
word of a string. print(21.5 // 4 + (8 + 3.0))
For example, if the string is "Come let us have 1. (a) 16 (b)14.0 (c) 15 (d) 15.5
some fun", the list will have [4, 3, 2, 4, 4, 3]
2. What will be the output of the following code 3. Find the error in following code. State the reason of the error.
snippet? aLst = { ‘a’:1 ,’ b’:2, ‘c’:3 }
values =[ ] print (aLst[‘a’,’b’])
for i in range (1,4):
values.append(i)
print(values)
Write a Python program to input 10 numbers to Write a Python program to enter a string from the user and
store in the list and print the third largest perform the following tasks and print the result after all
number. For example, if the entered numbers in operations:
the list are List are 36, 25, 14, - 951, 75, - 85, (i) Count the number of digits present in the string
654, 88, 9521, 657, then output will be The third (ii) Count the number of # and $ present in the string
largest number is : 654
Find and write the output of the following python Find and write the output of the following python code:
code: TXT = ["20","50","30","40"]
Data = ["P",20,"R",10,"S",30] CNT = 3
Times = 0 TOTAL = 0
Alpha = ""
Add = 0
for C in [7,5,4,6]:
for C in range(1,6,2): T = TXT[CNT]
Times= Times + C TOTAL = float (T) + C
Alpha= Alpha + Data[C-1]+"$" print TOTAL
Add = Add + Data[C] CNT-=1
print (Times,Add,Alpha)
What will be the output of following Python code? Consider a Dictionary
d1 = {“a” : 10, “b” : 2, “c”:3}
str1 = “ ”
Employee =
for i in d1: {“Empno‟:1,‟Name‟:‟Snehil‟,‟Salary‟:80000
str1 = str1 + str(d1[i]) + “ “ } Write statements:
str2 = str1[:-1] (i) to print employee name
print(str2[::-1])
(a) 3, 2 (b) 3,2,10 (c) 3,2,01 (d) Error
(ii) to update the salary from 80000 to 90000
(iii) to get all the values only from the
dictionary

Write a program that takes any two lists L and M Select the correct output of the code:
of the same size and adds their elements a = "Python! is amazing!"
together to form a new list N whose elements are a = a.split('!')
sums of the corresponding elements in L and M. b = a[0] + "." + a[1] + "." + a[2]
For print (b)
instance, if L = [3, 1, 4] and M = [1, 5, 9], then N (a) Python!. is amazing!. (b) Python. is amazing.
should equal [4,6,13]. (c) Python. ! is amazing.! (d) will show error
Design a Python program that employs a Given a dictionary of student grades, write a function to
dictionary to store the details of patients in a calculate the average grade for each
hospital, including their names, ages, and medical Student and return the result in a new dictionary.
records. The program should find patients by a Input: {"John": [80, 70, 90], "Jane": [90, 80, 70]}
Output: {"John": 80.0, "Jane": 80.0}
specific age range.

You might also like