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

PWP 22616 QB Unit Test II

PWP Question bank
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)
130 views3 pages

PWP 22616 QB Unit Test II

PWP Question bank
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

BHARATI VIDYAPEETH COLLEGE OF ENGINEERING

(DIPLOMA ENGINEERING)
QUESTION BANK

Unit Test-II
Program: - Computer Engineering Group Program Code:- CO
Course Title: Programming with Python Semester: - Sixth
Course Abbr & Code:-PWP (22616) Scheme: I

--------------------------------------------------------------------------------------------------

4. PYTHON FUNCTIONS, MODULES AND PACKAGE (14 MARKS)


2 Marks

1. Describe User-defined Function in python.(CO4)


2. Define Module in python? How to create a module and use it. (CO4)
3. Write different types of arguments in a function. (CO4)
4. Explain from...import statement. (CO4)
5. Shows the use of reduce function with an example. (CO4)
6. State the use of keyword global with simple example. (CO4)
7. Explain Data Conversion functions in python. (CO4)
8. Explain Local and Global variable. (CO4)

4 Marks

1. Define Package? Write the steps to create a package in python? (CO4)


2. Explain type conversion of variable in python. (CO4)
3. Write a function that takes single character and prints “Character is vowel” if it is vowel,
“Character is not vowel” otherwise. (CO4)
4. Write a python program to calculate factorial of given number using recursive function. (CO4)
5. Write a python program to find reverse of a given number using user defined function. (CO4)
6. Explain the following package with suitable example(CO4)
i) numpy ii) scipy iii) pandas iv) matplotlib
7. Explain python built in module(CO4)
i) Numeric and Mathematical Module. ii) Functional Programming Module
8. Write a program for importing module for addition and substraction of two numbers. (CO4)
5. OBJECT ORIENTED PROGRAMMING IN PYTHON (12 MARKS)

2 Marks

1. Define class? How to create an class and its object in python.(CO5)


2. State the use of parameter “self” in python class. (CO5)
3. Differentiate between method overloading and method overriding. (CO5)
4. Explain the use str () and repr () function in python. (CO5)
5. Explain Destructor in python. (CO5)
6. Describe Data Hiding. (CO5)
7. Explain constructor function in python class with example. (CO5)

4 Marks

1. Write a program to demonstrate parameterized constructor in base class and derived


class(CO5)
2. Write a program to demonstrate constructor with default arguments. (CO5)
3. Write a program to create a python class and delete object of that class using del keyword.
(CO5)
4. Explain inheritance in python with example. (CO5)
5. Create a class employee with data members: name, department and salary. Create suitable
methods for reading and printing employee information. (CO5)
6. Explain data abstraction in detail. (CO5)
7. Describe term composition classes with example. (CO5)
8. Explain method overloading in python with example. (CO5)

6. FILE I/O HANDLING AND EXCEPTION HANDLING (12 MARKS)


2 Marks

1. List four file modes in python.(CO6)


2. Explain open() and close() methods for opening and closing a file. (CO6)
3. Write use of try:finally block with Syntax. (CO6)
4. Describe print() functions with example. (CO6)
5. Give the syntax and significance of input() method. (CO6)
6. State the use of read() and readline() function in python file handling mechanism. (CO6)
7. State the use of write() and writeline() function in python file handling mechanism. (CO6)

4 Marks

1. Explain with an example, how to rename or delete File or Directory. (CO6)


2. Explain exception handling with example using try, except, raise keywords. (CO6)
3. Explain how to create a user defined exception with an example. (CO6)
4. Write a python program which will throw exception if the value entered by user is less than
zero. (CO6)
5. Write a python program to read contents of first.txt file and write same content in second.txt
file. (CO6)
6. Explain seek() and tell() functions for file pointer manipulation. (CO6)
7. Explain following python functions: (CO6)
i. getcwd()
ii. mkdir()
iii. chdir()
iv. listdir()
8. Write a program to open a file in write mode and append some contents at the end of file. (CO6)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy