We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 4
45t SHIFT RANCHI
\ KENDRIYA VIDYALAYA HINOO
PERIODIC TEST-2, SESSION 2022-23
CLASS: XI MAX MARKS 740
SUB: COMPUTER SCIENCE(083) TIME ALLOWED : 1:30 Hours
PART-A(Each Ques! Mark)
Q1. Which of the foilowing statement will create list? 1)
(A) L1=Hist( )
(B) L1=[1,2,3,4]
4€) Both of the above
(D) None of the above
Q2. Write the output of the following code: (1)
L=[1,2,3,4,5]
for iin L:
print(i,end="“)
1
4A) 1,2,3,4,5
(C) Error
Q3. Which of the following will give out 1)
If L=[6,23,3,2,0,9,8,75)
(A) print(list[4
$2) _ print(listt
Q4, To add a new element to a list we (1)
(A) list1.add(5)
(C)list1.addLast(5)
Q5. What is the output of following cod
L=[5, 8]
print (L* 3)
(A) Syntax error
4€) [15,24]
Q6. Choose correct op{Q7. Suppose list! is [2, 33, 222, 14, 25], What is list1[:-1]? "
A) [2, 33, 222, 14) (8) Error
{Qy 2 (D) [25, 14, 222, 33, 2]
Q8 Strings are immutable in Python, which means a string cannot be modified ia}
(A) True (B) False
Q9. Which of the following will result in an error? (1)
str1="python"
(A) print(str1[2}) (B) strt[t]="x"
(C)print(str1[0:9)) {B) Both (B) and (C)
(? 4
Q40. What will the below Python code will give output? (1)
list1=[0,2,5,1]
strt="7"
for iin list
strt=str1+i
print(strt)
(a)70251 (B)7 (c)1
Q114. Which of the following will give "Simon"
If str1="John,Simon Aryan"
AC) print(str‘[-11:-6))
Q12. What will be the output of followit
s="Welcome"
rint(s.split()))
print(|)
(A)[Welcome’]
[none]
(8) ['Welcome’]
['Welcome"]
Q13 (A) Assertion ;
(R) Reasor
(aAq21. What will be the output of the following code (3)
Msg="CompuTer"
Msg1="*
for iin range(0, len(Msg)):
if Msgfil.isupper():
Msg1=Msg1+Msgfi].lower()
elif i%2==0:
Msg1=Msg1+"*
else:
Msg1=Msg1+Msgli].upper()
print(Msg1)
22. Write a program to remove all odd elements from list of integers. 3]
For Example: If the if the list contains.. [2,4,5,6,7] then the output will be [2,4,6]
Q23. Write a program using a us
(A string is called palindrome if it
Q24.Write a program in python