Xi Hy CS 22-23
Xi Hy CS 22-23
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]
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)