Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Ramakrishna Mission Residential College (Autonomous)

Narendrapur, Kolkata – 700103


B.A./B.Sc. Second Semester Examinations, 2022
Subject: Computer Science (Generic)
Course Name: Programming using Python
Paper Code: HCOM2GE01L

Question-1 is compulsory. Answer any 5 questions from Section-I and Section-II taking at least 1
from each of the section.

1. Answer any five questions.


a) Differentiate between break and continue.
b) What do you mean by mutable and immutable objects in Python? Give examples.
c) How to define string of multiple lines in Python?
d) What is bitwise operator?
e) What is string and string slicing?
f) Describe different type of languages.
g) Why computer is call Data processor?
h) When decision table is required?
i) What is Pre-emptive process?
Section -I
2.
a) A company gives commission for their salesmen on the basis of sales as follows:
I. If sales amount is < Rs. 10000 – commission is Nil.
II. If sales amount is >= Rs. 10000 to < Rs. 50000 – commission is 5% of sales amount.
III. If sales amount is >= Rs. 50000 – commission is 10 % of sales amount.
Write an algorithm to calculate commission of the salesman.
b) Draw a flowchart to add up all the numbers between 0 and 100 which are divisible by 5.
(4+4)
3.
a) A Hard disk consists of 6 usable disk plates. Each plate has 400 tracks and there are 50 sectors
per track. If 512 bytes can be stored per sectors, calculate the storage capacity of the disk.

b) What is Register? Write the functions of various register present in control unit.
3 + (1 +4)

Section –II

4.
a) Differentiate between the following operators with the help of examples:
i) = and = =
ii) / and %
iii) / and //
iv) * and **
b) What do you mean by variables in Python? Differentiate between global variables and local
variables.
(4+(1+3))
5.
a) What is the function in Python? Demonstrate the use of different types of parameter passing in
user defined functions?
b) Write a Python Program to perform Linear Search.
((1+4)+3)
6.
a) Why do you need loops in Python programming? Make comparison between FOR and WHILE
loops in Python.
b) Write a Python program to get the biggest number from a list.
((2+3)+3)

Page 1 of 2
7.
a) What is a recursive function? Write a recursive function to find the reverse of a string. Take input
from the user.
b) Input two numbers from user and write Python program to find their GCD.

((1+4)+3)
8.
a) Discuss different data types in Python? Give examples.
b) Input a sentence from user and write a Program in Python to find number of vowels, consonants,
spaces and special characters.
(5+3)
9.
a) What do you know about control statements? Write Short note on that.
b) Write a Python program to find the repeated digits in a number using function concept.
((1+4)+3)
10. Find the output of the following codes in Python:
a) n= ‘50’
print(n+ ‘25’)

b) n=125
for i in n:
print(i)

c) List=list('string')
print(List)

d) List=[3, 4, 5, 12, 9]
print(List.pop(4))

e) address='B-6,NSC Bose Road,Kolkata'


print(address[18 : -1])

f) name= ‘RKM Residential College'


print(name.split())
g) a=[ ]
a.add(10)
print(a)

h) L1= [1,2,[3,5]]
L1[2][1]=4
print(L1)

(8×1)

Page 2 of 2

You might also like