0% found this document useful (0 votes)
26 views5 pages

Xi Hy CS 22-23

This document is a question paper for the Half Yearly Examination in Computer Science for Class XI at Army Public School, Patiala, covering various topics in Python programming. It consists of five sections with a total of 70 marks, including multiple-choice questions, short answer questions, and programming tasks. The exam tests knowledge on data types, list operations, dictionary manipulation, and basic programming concepts.
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)
26 views5 pages

Xi Hy CS 22-23

This document is a question paper for the Half Yearly Examination in Computer Science for Class XI at Army Public School, Patiala, covering various topics in Python programming. It consists of five sections with a total of 70 marks, including multiple-choice questions, short answer questions, and programming tasks. The exam tests knowledge on data types, list operations, dictionary manipulation, and basic programming concepts.
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/ 5

ARMY PUBLIC SCHOOL, PATIALA

HALF YEARLY EXAMINATION – 2022-23


CLASS – XI
SUBJECT-COMPUTER SCIENCE
Time Allowed : 3 Hrs MM - 70
General Instructions:
1. This question paper contains five sections, Section A to E.
2. All questions are compulsory.
3. Section A have 18 questions carrying 01 mark each.
4. Section B has 07 Very Short Answer type questions carrying 02 marks each.
5. Section C has 05 Short Answer type questions carrying 03 marks each.
6. Section D has 03 Long Answer type questions carrying 05 marks each.
7. Section E has 02 questions carrying 04 marks each.
8. All programming questions are to be answered using Python Language only.
Section-A
1 What will be the output of the following code ? 1
print(“100”+ “200”)
(a) 300 (b) 100200 (c) 100+200 (d) 200
2 What is the output of the following ? 1
x = “123”
for i in x:
print(i,end=””)
(a) 123 (b) 1 2 3 (c) error (d) infinite
3 What data type is the object below? 1
d = [1, 23, ‘hello’,1]
( a) list (b) dictionary (c) array (d) tuple
4 Given the lists L=[1,30,67,86,23,15,37,131,9232] , write the output of 1
print(L[3:7:2])
( a) [67,86,23,15,37] (b) [86,23,15,37] (c) [86,15] (d) [30,86,15,131]
5 A list is declared as 1
Lst = [1,2,3,4,5,6,8]
What will be the value of sum(Lst)?
29 (ii) 30 (iii) 7 (iv) 8
6 Can we modify/change keys of a dictionary? 1
(a) Yes (b) No
7 Which of the following is/are valid declaration of a dictionary? 1
a) D = {'StuName': 'Alan', 'StuAge': 30, 'StuCity': 'Vizag'}
b) D = ['StuName': 'Alan', 'StuAge': 30, 'StuCity': 'Vizag']
c) D = ('StuName': 'Alan', 'StuAge': 30, 'StuCity': 'Vizag')
d) D = {'StuName'; 'Alan', 'StuAge': 30, 'StuCity': 'Vizag'}
8 Write the output of the following python expression: 1
print((4>5) and (2!=1) or (4<9))
(a)False (b) True
9 Which value type does input() return? 1
(a) Boolean (b) String (c) Int (d) Float
1 The operator _____ tells if an element is present in a sequence or not. 1
0 (a) exists (b) in (c) into (d) inside
1 What is the output when we execute list(“hello”)? 1
1 a) [‘h’, ‘e’, ‘l’, ‘l’, ‘o’] b) [‘hello’]
c) [‘llo’] d) [‘olleh’]
1 Suppose list1 is [2, 33, 222, 14, 25], What is list1[-1]? 1
2 a) Error b) None c) 25 d) 2
1 To add a new element to a list we use which command? 1
3 a) list1.add(5)
b) list1.append(5)
c) list1.addLast(5)
d) list1.addEnd(5)
1 To insert 5 to the third position in list1, we use which command? 1
4 a) list1.insert(3, 5)
b) list1.insert(2, 5)
c) list1.add(3, 5)
d) list1.append(3, 5)
1 Suppose list1 is [3, 4, 5, 20, 5], what is list1.index(5)? 1
5 a) 0 b) 1 c) 4 d) 2
1 Suppose d = {“john”:40, “peter”:45}, to delete the entry for “john” what command 1
6 do we use?
a) d.delete(“john”:40)
b) d.delete(“john”)
c) del d[“john”]
d) del d(“john”:40)
1 What is the value of the expression 4+2**5//10 1
7 a) 1233
b) 7
c) 9
d) 45
1 Consider the tuple in python named DAYS=(”SUN”,”MON”,”TUES”).Identify the 1
8 invalid statement(s) from the given below statements and give reason for your
answer.
1. S=DAYS[1]
2. print(DAYS[2])
3. DAYS[0]=”WED”

Section-B
1 What is the need of RAM? How does it differ from ROM? 2
9
2 Write base values of binary, octal and hexadecimal number system. Also write 2
0 symbols for the same.
2 Explain analysis and design phase of PDLC 2
1
2 WAP in Python to print the following pattern: 2
2 1
22
333
4444
55555
or
Whatwillbetheoutputofthefollowingcode?
for i in range(1,5):
print('#'*i)
2 What will be output of the following code? Give reason for your answer. 2
3
List1=[10,50,78,45,35,12]
List2=List1
List1[1]=100
print(List2)
2 What are comments? Explain 2 types of comments in python. 2
4
2 TypeError occurs while statement 2 is running. Give reason. How can it be 2
5 corrected?
>>> tuple1 = (5) #statement 1
>>> len(tuple1) #statement 2

Section- C
2 3
6

2 Differentiate between 3
7 i. / and //
ii. * and **
iii. = and ==
2 What are bugs? Explain different types of bugs with example. 3
8
2 Name the input or output device or storage device used to do the following: 3
9 a) To output audio
b) To enter textual data
c) To make hard copy of a text file
d) To display the data or information
e) To enter audio-based command
f) To store data permanently
3 Try the following conversions. 3
0 (i) (514)8 = (?)10 (ii) (4D9)16= (?)2 (iii) (220)10 = (?)2

Section-D

3 Depending upon lists L1, L2 and L3 give the output of the following 5
1
commands:
L1=[500,600]
L2=[70,66,99,80]
1. L1.append(L2)
print(L1)
2. L3=L1+[88,99,77]
print(L3)
3. L1.extend(L2)
print(L1)
4. L1.sort()
print(L1)
5. L3=sorted(L1)
print(L1)
or
a) Write pyton code to define a list of 10 elements create another list named
‘indexList’ that stores the indices of all Non-Zero Elements of L.
For example: If L contains [12,4,0,11,0,56] The indexList will have -
[0,1,3,5]

b) Differentiate between following with example with reference to list


i) sort() and sorted()
ii) extend() and append()

3 Consider the dictionary dict3 and answer the questions that 5


2 follows(considering statements are in flow:
dict3={1:'One',4:'Four',6:'Six',2:'Two',3:'Three'}

a) dict3[7]= “Seven”
dict3[6]=“NEW”
print(dict3)
b) print(dict3.get(6))
c) print(dict3.keys())
d) print(len(dict3))
e) del dict3[3]
print(dict3)

3 a) Differentiate between break and continue statements using examples. 5


3 b) Write a program to print the table of a given number. The number has to
be entered by the user.
Section-E

3 Consider the following tuple and give the output of following 4


4 x=(100,200,300,400,500,600,700,200,300,500)
a) print (min(x))
b) print(x[0]+100)
c) print(x.count(500)
d) print(x.index(400))
e) print(max(x)+len(x))
f)
3 A) Study the following program which has an unintended error and answer 4
5 questions

i. What is the programmer trying to do in the program?


a. Print all the odd numbers from 1 to 10
b. Print the total of all numbers from 1 to 10
c. For each number till 10, print the sum of numbers between 1 and the
number.
d. For each number till 10, print the sum of the number and its previous
number
ii. Identify the error in the program
a. sum = 0 should be BEFORE the while statement
b. The range should be from 0 (not 1) to i + 1
c. i = i + 1 should be added after the print statement
d. There is no error in the program

B) Identify the output of the following Python statements.


b=1
for a in range(1, 10, 2):
b += a + 2
print(b)
a. 31 b. 33 c. 36 d. 39
C) Identify the output of the following Python statements.
x=2
while x < 9:
print(x, end='')
x=x+1

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy