Cst362 Programming in Python, January 2024
Cst362 Programming in Python, January 2024
Reg No.:
I I a) Discuss the steps involved in the waterfall model of software development (8)
process with the help of a neat diagram.
t
b) Write a Python program to print all numbensfbtween 100 and 1000 whose sum (6)
of digits is divisible by 9.
OR
12 E Illustrate the use of ranlee in pythin. e
(6)
b) writea Python program to print all prime factors of a given number. (s)
Module ll
13 a) write a Python program to compute.the sum of the series (l- + (6)
xz/21 x4/4! -
x6l6!+..........n terms).
b) Illustrate the use of iny four dictionary methods. (8)
Page lof3
1200csT36205230L
OR
14 a) Write a Python program tobonvert a decimal number to its binary equivalent. (7)
b) Write a Fython program to read a text file and store the count of occurrences of (7)
each character in a dictionarv.
Module lll
15 a) write a Srthon program to convert a coror image to a grayscale image. (6)
b) Explain the attributes and methods of Turtle object. (8)
OR
16 a) Write Python GUI program to input two strings and output a concatenated string (6)
' when a button is pressed.
b) Discuss on the types of window components and their functions. (8)
Module lV
17 a) Illustrate the use of abstract classes in python. (6)
b) Define a class Student in Python with attributes to store the roll number, name (8)
and marks of three subjects for each student. Define the following methods:
OR
I
l8 a) Explain, with the help of suitable examples, the different types of inheritance. (8)
b) Write a Python program to demonstrate the use of try, except and finally blocks. (6)
Module V
l9 a) consider a csV file 'weather.csv' with the following columns (date, (8)
temperature, humidity, windSpeed, precipiJationType, prace, weather
{Rainy,
Cloudy, Sunny)).
Write commands to do the following using pandas library.
1. Print first l0 rows of weather data- b
Page2of3
I
fl(xrcsT362052301
b) Explain the different ways by which numpy arrays are created. (6)
rOR
20 a) Write Python program to write the data given below to a CSV file. ' (5)
b) Write a $thon program to input two matrices and perform the following (9)
operations using numpy and display the results:
t. Add the matrices
2. Subtract the matrices
3. Multiply the matrices
4. Find transpose of the matrices
* *!tt
Page 3of3