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

CU-2021 B.Sc. (Honours) Computer Science Semester-5 Paper-DSE-B-2 QP

This document is an examination paper for a Computer Science Honours course focusing on Programming Using Python. It consists of multiple sections with questions covering various Python concepts such as string manipulation, polymorphism, exception handling, and file operations. Candidates are required to answer specific questions to demonstrate their understanding of Python programming.

Uploaded by

sayan1237sayan
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)
5 views2 pages

CU-2021 B.Sc. (Honours) Computer Science Semester-5 Paper-DSE-B-2 QP

This document is an examination paper for a Computer Science Honours course focusing on Programming Using Python. It consists of multiple sections with questions covering various Python concepts such as string manipulation, polymorphism, exception handling, and file operations. Candidates are required to answer specific questions to demonstrate their understanding of Python programming.

Uploaded by

sayan1237sayan
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

(1) V(5th Sm.)-Computer Sc.

-H/DSE-B-2/CBCS

2021
COMPUTER SCIENCE — HONOURS
Paper : DSE-B-2
(Programming Using Python)
Full Marks : 50

The figures in the margin indicate full marks.


Candidates are required to give their answers in their own words
as far as practicable.

Answer question no. 1 and any four questions from the rest.

Section - I

1. Answer any five questions of the following : 2×5


(a) What is the role of the function strip()?
(b) How can we access the middle element of a string?
(c) What is the role of the function–index?
(d) Explain how string formatting works in Python.
(e) Explain with examples how break and continue statements works.
(f) How exception handling works in Python?
(g) How an element can be detected from a dictionary?
(h) What are different parameters in range?

Section - II

2. (a) Discuss polymorphism with suitable example with respect to Python.


(b) State the purpose of enumerate() in Python.
(c) State the differences between deep copy and shallow copy. 4+3+3
3. (a) Write a program in Python that takes input from user and calculate area and perimeter of a cylinder.
(b) Explain mutability in Python.
(c) What does the ‘%’ operator do in Python? 4+4+2
4. (a) What is the use of Lambda expression? Explain how the map function works.
(b) Explain different access modifiers that are available in Python. Create a simple function which takes
a string as an input and returns its length. (2+2)+(3+3)

Please Turn Over


V(5th Sm.)-Computer Sc.-H/DSE-B-2/CBCS (2)
5. (a) Create a string with a value ‘Computer Science’. Print the string as “cOMPUTER sCIENCE”.
(b) How the read function works? Explain the role of seek() function in context to read. 6+(2+2)
6. (a) Write a program in Python to display the pattern given below :
1
01
101
0101
10101
(b) Explain different types of operators in Python with examples. 5+5
7. (a) Write a recursive function to check whether the user given input value is a magic number or not.
(Note : Say n = 1999 digit sum of n  1+9+9+9 = 28  2+8 = 10  1+0 = 1
hence n is a magic number : that is 1999 is a magic number.)
(b) What is the utility of append function? Explain with an example. 5+5
8. (a) Write a program in Python that can read a text file and display the number of characters, number
of words, lines contained in the text file.
(b) What are the usages of ‘ \ t’ and ‘*’ operators on string in Python? When the value error occurs
in Python? 4+(2+2+2)
9. (a) How a tuple is created in Python, explain with Example.
(b) Differentiate between Syntax error and exception.
(c) What is the purpose of break and exception?
(d) Explain the utility of doc string. 4+2+2+2

You might also like