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

Python Model Question Paper 2

This document contains a model question paper for a Python programming exam with 10 questions covering various Python concepts. It provides instructions to students to answer 5 full questions out of the 10. Each question is worth between 6-10 marks and covers different cognitive levels and learning outcomes. The questions cover topics like variables and scope, command line arguments, functions, strings, lists, dictionaries, files, classes, inheritance and polymorphism.

Uploaded by

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

Python Model Question Paper 2

This document contains a model question paper for a Python programming exam with 10 questions covering various Python concepts. It provides instructions to students to answer 5 full questions out of the 10. Each question is worth between 6-10 marks and covers different cognitive levels and learning outcomes. The questions cover topics like variables and scope, command line arguments, functions, strings, lists, dictionaries, files, classes, inheritance and polymorphism.

Uploaded by

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

(Page 1 of 3)

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

PYTHON PROGRAMMING
(Model Question Paper – II)

Time: 3 Hours] [Maximum Marks: 100


Instructions to students:
Answer FIVE FULL questions

RBT
Q.No. Questions Marks CO Cognitive
Level
Explain the concept of scope and lifetime of variables in
a) 8 CO1 L2
Python programming language with an example.
Explain command line arguments and write a program to
1. b) 6 CO1 L2
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 ascending
3. b) order using Bubble Sort by passing the list as an argument to 7 CO3 L3
the function call.
Write Python program to perform a linear search for a given
c) 6 CO3 L3
Key number in the list and report Success or Failure.
OR
4. Write Python program that accepts a sentence and calculate
a) the number of words, digits, uppercase letters and lowercase 8 CO2 L3
letters.
b) Write Python program to convert uppercase letters to 6 CO2 L3
lowercase and vice versa.

Dr. Ambedkar Institute of Technology, Bengaluru – 560056


(An Autonomous Institution Affiliated to Visvesvaraya Technological University, Belgaum)
(Page 2 of 3)
Discuss format specifiers and escape sequences with
c) 6 CO2 L2
examples.
8
Write Python program to check for the presence of a key in
a) 7 CO3 L3
the dictionary and find the sum all its values.
Write Python Program to count the number of characters in a
5. b) string using dictionaries. Display the keys and their values in 7 CO3 L3
alphabetical Order.
Write Python Program to count the number of times an item
c) 6 CO3 L3
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
6. b. Registration Number
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 contains
c) 6 CO3 L3
(i: i*i) such that i is a number ranging from 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
b) create and process valid names for files and directories in 6 CO4 L2
Windows and Linux Operating systems.
Explain the different methods available for manipulating the
c) 6 CO4 L2
CSV files.
OR
Write Python program to change the file extension from .txt
a) to .csv of all the files (including from sub directories) for a 7 CO4 L3
given path.
8. Explain the need for Pickle module. Write Python program
b) 7 CO4 L2
to save dictionary in Python Pickle.
Illustrate the difference between fully qualified path and
c) 6 CO4 L2
relative path with an example.

9. a) Discuss the need for Method Resolution Order and the steps 10 CO5 L2
to follow in construction of C3 linearization MRO 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
b) Program to Create a Class Called as Complex and 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 Opera,
a) 10 CO5 L3
while Start Time and Duration are Given.
10. Given a point(x, y), write Python program to find whether it
b) lies in the First, Second, Third or Fourth Quadrant of x - y 10 CO5 L3
Plane.

******

Dr. Ambedkar Institute of Technology, Bengaluru – 560056


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

You might also like