Ililil til]t ilt Iilil fllllt ilt ilil] il llilI illl ilil
ffi
lil
Reg. No.
BSCCSCN 501
Fifth Semester B.Sc. Degree Examination, December 2A23lJanuary 2024
(NEP-20201 (2023 - 24 Batch Onwards)
COMPUTER SCIENCE
Programming in Python
Time : 2 Hours Max. Marks:60
Note: Answer any six questions from Part - A and one full question
from each Unit in Part - B.
PART -A (6x2-12)
1. a) How do you determine the data type of a variable ? Explain with an
example.
b) Write the syntax of if..elif statement in Python.
c) Give two methods of creating strings in Python.
d) What is the output of
tuple - ('abcd', 786,2.23, 'john', 7A.2\
print (tuple[1:3])
e) Give the syntax of with statement to open a file.
f) What is root window ? How it is created in Python ?
g) Write SQL code to create table in SQLite database.
h) List any four NumPy array attributes.
PART _ B
Unit - I
2. a) Explain various data types in Python.
b) Explain while and for loops with syntax and example.
c) Explain use of string.format and f-string with printQ function. (4+4+41
P.T.O.
BSCCSCN 501 ililil iltil fi1 ffiilffiIilil ilil] il ]ilt ilil illl fft
3. a) Explain the arithmetic operators and logical operators with an example.
b) With syntax and example explain how to define and call a function in
Python.
c) How to read different types of input from the keyboard ? Give examples. $+a+A)
Unit - ll
4. a) With example explain how to Access and Modify key:value Pairs in
Dictionaries.
b) Explain any four list methods with syntax and example.
c) Write a note on indexing and slicing tuples. (4+4+41
5. a) Explain concatenation, repetition and membership operations on string.
b) Explain any five set methods. (6+6)
Unit - lll
6. a) Explain any four file opening modes with examples.
b) Explain with example overriding superclass constructor and method.
c) How to create a button widget and bind it to the event handler ? Explain with
example. (4+4+41
7. a) Explain declaring a class, defining an object and constructor with syntax
and example.
b) Write a note on arranging widgets in a frame using layout managers. (6+6)
Unit - lV
B. a) Explain any four NumPy array creation functions with example.
b) With code examples explain creating pandas series using scalar data and
dictionary.
c) Explain Bar Graph creation using Matplot library module. (4+4+41
9.a) Explain four SQLite module methods required to use SQLite database.
b) Explain with example any two methods of creating DataFrame. (6+6)