PAP-Solution 18CS752 15CS664
PAP-Solution 18CS752 15CS664
USN 15CS664
Note: Answer any FlVEful questions, choosing ONEfull question from each module.
(04 Marks)
OR
2 a. Write
program which prompts
a the user
för a Celsius temperature, convert the temperature
to
Fahrenheit and print the converted temperáture. (06 Marks)
b. Explain nested conditional statement with an example. (04 Marks)
C WTite a prögram with a function domputer grade that takes a score as its parameter and
returns a grade as a string.
(06 Marks)
Module-2
a. Anaiyze the of break
and continue statement with an example.
use
(06 Marks)
b. Explain format operators in python with suitable examples. (03 Marks)
- Define a file data structure. lllustrate
reading and writing operation on files with examples.
(07 Marks)
OR
4 a. Write a program to read numbers repeatedly until the user enters 'done'.
Once 'done' is
entered print out total, count and average of the numbers,
(06 Marks)
. Write a note on string methods.
(07 Marks)
Write a program to read through a file and print the contents of the file
(line by line) all in
uppercase. (03 Marks)
5
Module-3
a. Explain list operations and list methods with examples.
b. Write (05 Marks)
a
program to count how maný times each letter appears in a word. (07 Marks)
C. Explain tuple asignment with examples. (04 Marks)
OR
6 a. Write a program to opeoA filé and read it line by line. For each
words using split function. For each word check to see if the line, split the line into list of
word is already in a list. If the
word is not in the lis1, add it to the list.
b. Explain advanced (06 Marks)
text parsing using dictionary. (07 Marks)
C. Why search and find all functions of regular expressions used?
examples. Explain with suitable
(03 Marks)
I of 2
ELL
15CS664
71 a. Define class. Explain classes Module-4
and objects of
python in,detil with suitable
examples.
b. What is a pure
function? Explain with an example (10 Marks)
(06 Marks)
8 a.
a. Write a
program with a function OK
print_timehat
hour:minute:second. Write another function is takes a time objectand prints it in the form
resume True ift
follows t2 after that takes two time
b. Write a note on chronglagically and False otherwise objects ti and t2 and
operator overloadingjWith an (08 Marks)
example. (08 Marks)
9 a.How to retrieve web Modulc-5
the file retrieved. pagéSuSing urllib? Explain howtocompute
b. What is an API? frequency of each word in
Explainawith a neat sketch. (08 Marks)
(08 Marks)
10 a. Write programsto read binary files.
a ORA
b. Explain keýs ina database model. (08 Marks)
(08 Marks)
T
VD
tikiy
Name of facul+y Prof. Rauindra Poiu
De poht nea
Cosmpu Sest nde énag
Cer Se s .
alla
StaPt Tnchoohi HoD Dean' AcadtmiC
Dean, Academics
KLS
VD1T, HALIYAL
CO
KLS ih¥
rstitute of Tactnoiogy, Haliy.