Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
44 views

cst362 Programming in Python June 2022

Uploaded by

ktusemester
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

cst362 Programming in Python June 2022

Uploaded by

ktusemester
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

lOMoARcPSD|31948820

CST362 Programming IN Python, JUNE 2022

Programing Using Python (APJ Abdul Kalam Technological University)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by DAMU GAMING (arunkphilip6677@gmail.com)
lOMoARcPSD|31948820

D 0300csT362052202

Reg No.: Name:

APJ ABDUL KALAM TECIINOLOGICAL TJNIVE


Sixth Semester B.Tech Degtee Examination June 2022 (2019 Sc

Course Code: CST362


Course Name: PROGRAMMING IN PYTHON
Max. Marks: 100 Duration: 3 Hours
PART A
Answer all questions, eoch carries 3 marks. Marks

I What is the output of the following print statement in $rthon? (3)

(a) print (9//2) (b) print (9/2)

Write a Python program to count number of even numbers and odd numbers in (3)

a given set of n numbers.

Illustrate the use of negative indexing of list with example. (3)

Write Python code for the following statements (3)

i)writes the text "PROGRAMMING IN PYTHON" to a file with name code.txt


ii) then reads the text again and prints it to the screen.
5 List any three image processing Sthon libraries. (3)

6 List the steps to create a GUI application using Tkinter (3)

7 How to create a destructor in Python? Give an example. (3)

8 Write a Pyhon class which has two methods get_distance and print distance. (3)
I
get distance accept a distance in kilomefres from the user and print_distance
print the distance in meter.
9 How do you assign a ranclom number to a variable in Pyhon? (3)

t0 What is the use of os module in python? (3)

PART F-
Answer onefull questionfrom each module, each carries 14 mnrks.
Module I
11 a) Write a python program to generate the following type of pattern for the given N (6)

rows.
.1

t2
t23
1234.

Page 1of3

Downloaded by DAMU GAMING (arunkphilip6677@gmail.com)


lOMoARcPSD|31948820

o300csT352052202

b) Mention the different typis of loop and control statements allowed in Python (8)
and explain each type with suitable examples

OR
12 a) Write the python program to print all prime numbers less than 1000. (7)
b) Write a Python program to find distance between two points (xl,yl) and (x2,y2). (7)
Module II
13 a) Write a Python program to count how many times each character appears in a (7)
given string and store the count in a dictionary with key as the character.
b) Create a function min_max0 that takes n numbers as list argument and return the (7)
smallest and largest numbers.
,f OR
14 a) Write a Python program to read n integers into a list and separate the positive (7)
and negative numbers into two different lists.

b) Create a dictionary of names and birthdays. Write a Python program that asks (7)
the user to enter a name, and the program display the birthday of that person.
Module III
15 a) How to draw a star shape using turtle in Python. (5)
b) Explain basic image processing with inbuilt functions in $rthon. (9)
OR
16 a) Write Python GUI program to take the birth date and output the age when a (7)
r button is pressed.
b) How do you display an image in Python GUI?. (7)
1 .--: Module IV
l7 a) Demonstrate how polymorphism can be implemented using function '(7)
* overloading with suitable example. _j I

b) Illustrate with a real life example how multi-level inheritance is implemented in (7)
Python.
OR
18 a) Create an Abstract Base Class called Shape that include abstract methods areaQ (7)
- unO circumferenceQ. Then derive two classes Circle and Rectangle from

the Shape class and implement the area0 and circumference$ methods . Write a
Python program to implement above concept.
b) How elceptionsare handled in Python?. Illustrate with the help of an example. (7)

Page2of3

Downloaded by DAMU GAMING (arunkphilip6677@gmail.com)


lOMoARcPSD|31948820

GFOCSlil62AS2202

"
Modalc V
19 a) Explain how the matrix multiplitations are done using numpy arrays. (7)
b) How to plot two or more lines on a same plot with suitable legends, labels and i iZl
title.
OR
20 a) Consider a CSV file 'employee.csv' with the following (8)
' columnsftarne, gendgr, start_date ,salary, team).
Write commands to do the following using panda library.
l. print first 7 records fiom employees file
, 2. print all employee names in alphabetical order
3. find the name ofthe employee with highest salary
.rl
4. list the names of male employees
5. to which all teams employees belong
b) Write Pyhon program to write the data given below to a CSV file (6)

Res no Name Sub Markl Sub Mark2 Sub Mark3


lmol Jack 76 88 76
10002 John 77 84 79
r0003 Alex 74 79 8l
t***

Page 3of3

Downloaded by DAMU GAMING (arunkphilip6677@gmail.com)

You might also like