[go: up one dir, main page]

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

Xi Computer Science

This document outlines the Class XI Computer Science PT-2 Examination for January 2024 at PM Shri Kendriya Vidyalaya Sitapur, focusing on Python programming. It includes various questions related to Python concepts such as loops, data types, and functions, along with practical coding tasks. The exam has a total duration of 1.5 hours and is worth a maximum of 35 marks.

Uploaded by

eshanthbasu2008
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)
22 views2 pages

Xi Computer Science

This document outlines the Class XI Computer Science PT-2 Examination for January 2024 at PM Shri Kendriya Vidyalaya Sitapur, focusing on Python programming. It includes various questions related to Python concepts such as loops, data types, and functions, along with practical coding tasks. The exam has a total duration of 1.5 hours and is worth a maximum of 35 marks.

Uploaded by

eshanthbasu2008
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
You are on page 1/ 2

PM SHRI KENDRIYA VIDYALAYA SITAPUR – shift-1

PT-2 EXAMINATION, Class XI – JAN 2024


COMPUTER SCIENCE (083)
Time : 1.5 hours Maximum Marks : 35
General Instructions:
Programming Language: Python

1 The ……… statement if used for selection or decision making: 1


i) while ii) for iii) if iv) def
2 Consider the statements I and II 1
I) The output of following code is 5
a=5
while a> 5:
a+=1
print( a )
II) If the condition of while loop is initially false, the body of while loop is not executed even
once.
a) I is true and II is false
b) I is false and II is true
c) Both I and II are true and II is the correct explanation of I
d) Both I and II are true and II is not the correct explanation of I
3 Strings in python are ………….. 1
a) mutable b) immutable c) decision constructs d) None of these
4 The output of following code: 1
list1=[1,2,3,4,5]
print(list1[len(list1)-1])
a) 3 b) 5 c) 2 d) 4
5 Lists are ………… sequences in Python 1
a) mutable b) immutable c) set d) ordinary
6 Add the elements of [ 3, 4, 5] at the last of [ 1, 2] , so that the result will be [ 1, 2, 3, 4, 5] 1
[1 , 2].________( [3, 4, 5])
Choose the correct function name , to accomplish the task
a) insert b) add c) append d) extend
7 Choose the correct output of following code: 1
tuple1= ( 5, )
print( tuple1 * 4)
a) (20 , ) b) 20 c) ( 5, 5, 5, 5) d) (5, 4)
8 From a dictionary, ………. Returns a list of key,value pairs 1
a) keys( ) b) values( ) c) items( ) d) none of these
9 What is the purpose of range( ) function ? Give one example. 1
10 Consider the following string mySubject 1
mySubject = ‘Computer Science’
What will be the output of following statement?
Print( mySubject[ -7 : -1 ] )
11 If in the Python code, the percentage marks of all candidates are stored / extracted into the 1
list variable named all_percent.
e.g. for 5 candidates
all_percent = [ 84.2 , 60 , 81, 74, 63.2 ]
Then write the python code to show / print the highest percentage marks among applicants.
12 What will be the output of the following code segment: 2
myList = [1,2,3,4,5,6,7,8,9,10]
del myList[:3]
print(myList)
13 Why the following code is giving error ? 2
tuple1 = (2,4,6,8,10,12)
print( tuple1[6] )
14 Write the output of following code: 2
d = { ‘abc’: 65, ‘cde’: 67 , ‘xyz’:64 }
print ( len(d) )
15 Write the function name of the dictionary, which removes all items of the dictionary 2
16 Differentiate between break and continue statement using examples. 3
17 Differentitae between append and extend functions of list. 3
18 Consider the following dictionary: 3
stateCapital = { “AndhraPradesh” : “Hyderabad”, “WestBengal”:”Kolkata” ,
“Maharashtra”:”Mumbai” , “Tamilnadu”: “Chennai”}
Find the output of following statements:
i. print( stateCapital.get(“West Bengal”))
ii. del stateCapital [ “Tamilnadu” ]
print ( stateCapital )
19 Write the python program to show all prime numbers between 2 to 50 3
OR
Write the Python program to input the percentage, and show the grade as per following
criteria
percentage above 90 A
percentage between 50 to 90 B
percentage below 50 C
20 The record of a student (Name, Roll No, Marks in five subjects, percentage of marks) is 4
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’
OR
Write a python program to input your friends’ names and their Phone Numbers and store
them in the dictionary as the key-value pair. Perform the following operations on the
dictionary.
a) Display the name and phone number of all the friends.
b) Add a new key-value pair in this dictionary and show the modified dictionary.

You might also like