0% found this document useful (0 votes)
37 views3 pages

Py 5

Uploaded by

Pavan SB
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)
37 views3 pages

Py 5

Uploaded by

Pavan SB
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/ 3

(Page 1 of 1)

USN 18CS34
B. E. Degree (Autonomous) Third Semester End Examination (SEE)

PYTHON PROGRAMMING
(Model Question Paper – II)
Time: 3 Hours] [Maximum M
Instructions to students:
Answer FIVE FULL questions

RBT
Q.No. Questions Marks CO Cognitive
Level
Explain the concept of scope and lifetime of variables
a) 8 CO1 L2
in Python programming language with an example.
Explain command line arguments and write a program
1. b) 6 CO1 L2
to demonstrate command line arguments.
Write a Python program to check if a 3 digit number is
c) 6 CO1 L3
Armstrong number or not.
OR
Illustrate *args and **kwargs parameters in Python
a) 7 CO1 L2
programming language with an example.
Report the Value for sin(x) up to n terms
using the series
2. b) 7 CO1 L3
where x is in
degrees
c) Write Pythonic code to find the factorial of a number. 6 CO1 L3

a) Write Python program to implement Stack operations. 7 CO3 L3


Write Python program to sort numbers in a list in
b) ascending order using Bubble Sort by passing the list 7 CO3 L3
3. as an argument to the function call.
Write Python program to perform a linear search for a
c) given Key number in the list and report Success or 6 CO3 L3
Failure.
OR
Write Python program that accepts a sentence and
a) calculate the number of words, digits, uppercase letters 8 CO2 L3
and lowercase letters.
4. Write Python program to convert uppercase letters to
b) 6 CO2 L3
lowercase and vice versa.
Discuss format specifiers and escape sequences with
c) 6 CO2 L2
examples.

Dr. Ambedkar Institute of Technology, Bengaluru – 560056


(An Autonomous Institution Affiliated to Visvesvaraya Technological University, Belgaum)
(Page 2 of 2)
8
Write Python program to check for the presence of a
a) 7 CO3 L3
key in the dictionary and find the sum all its values.
Write Python Program to count the number of
5. b) characters in a string using dictionaries. Display the 7 CO3 L3
keys and their values in alphabetical Order.
Write Python Program to count the number of times an
c) 6 CO3 L3
item appears in the list.
OR
Write a Python Program to input information for n
number of students as given below:
a) a. Name 8 CO3 L3
b. Registration Number
6. c. Total Marks
Discuss the following dictionary methods with an
example.
b) 6 CO3 L2
a) get() b) keys() c) pop() d) update() e) values() f)
items()
Write Python program to generate a dictionary that
c) contains (i: i*i) such that i is a number ranging from 6 CO3 L3
1 to n.

Write a Python program to check the validity of a


password given by the user.
The Password should satisfy the following criteria:
1. Contain at least 1 letter between a and z
a) 2. Contain at least 1 number between 0 and 9 8 CO4 L3
3. Contain at least 1 letter between A and Z
4. Contain at least 1 character from $, #, @
7. 5. Minimum length of password: 6
6. Maximum length of password: 12
Discuss the fundamental rules that enable an
application to create and process valid names for files
b) 6 CO4 L2
and directories in Windows and Linux Operating
systems.
Explain the different methods available for
c) 6 CO4 L2
manipulating the CSV files.
OR
Write Python program to change the file extension from
a) .txt to .csv of all the files (including from sub 7 CO4 L3
directories) for a given path.
8. Explain the need for Pickle module. Write Python
b) 7 CO4 L2
program to save dictionary in Python Pickle.
Illustrate the difference between fully qualified path
c) 6 CO4 L2
and relative path with an example.

9. Discuss the need for Method Resolution Order and the


a) steps to follow in construction of C3 linearization MRO 10 CO5 L2
for a class.

Dr. Ambedkar Institute of Technology, Bengaluru – 560056


(An Autonomous Institution Affiliated to Visvesvaraya Technological University, Belgaum)
(Page 3 of 3)
Discuss polymorphism as implemented in Python
programming language with an example. Write Python
Program to Create a Class Called as Complex and
b) 10 CO5 L2
Implement __add__() Method to Add Two Complex
Numbers. Display the result by overloading the +
Operator.
OR
Write Pythonic code to compute the End Time of an
a) 10 CO5 L3
Opera, while Start Time and Duration are Given.
10
Given a point(x, y), write Python program to find
.
b) whether it lies in the First, Second, Third or Fourth 10 CO5 L3
Quadrant of x - y Plane.

******

Dr. Ambedkar Institute of Technology, Bengaluru – 560056


(An Autonomous Institution Affiliated to Visvesvaraya Technological University, Belgaum)

You might also like