0% found this document useful (0 votes)
10 views1 page

Question Bank Python

Its a python important question bank of vtu

Uploaded by

bhavyabhavi1124
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)
10 views1 page

Question Bank Python

Its a python important question bank of vtu

Uploaded by

bhavyabhavi1124
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/ 1

Question Bank

Module 4
1) Illustrate the following file operations in python with suitable examples.
i)Copying files and folders.
ii)Moving and renaming files and folders.
iii)Permanently deleting files and folders.
iv)Safe delete with send2trash module
2) Explain the following
shutil.copytree(path,path) b. os.unlink(path) c. os.rmdir(path) d. shutil.rmtree(path)
e)shutil.move(path, path)
3) Demonstrate reading, extracting and creating zip files in python with code.
4) Explain any 5 Logging levels with suitable example.
5) Explain the short note on Walking a Directory Tree. Or Explain OS.walk() function with python
code.
6) Explain the breakpoints with example
7) Explain Assertion with an example program.
8) Explain the raising exceptions method in debugging.
9) Discuss assertion and logging in python with example.
10) Explain the five buttons in the debug control window.
11) Develop a program to backing up a given Folder (Folder in a current working directory) into
a ZIP File by using relevant modules and suitable methods.
12) Write a function named DivExp which takes TWO parameters a, b and returns a value c
(c=a/b). Write suitable assertion for a>0 in function DivExp and raise an exception for when
b=0. Develop a suitable program which reads two values from the console and calls a function
DivExp.
Module 5
1) Define class and object.
2) Write an example for creating a class and an object of that class.
3) Write a program to create a class called Rectangle with the help of a corner point, width and
height. Explain instance as return values with suitable code snippet.
4) Explain operator overloading
5) Explain polymorphism in python with examples.
6) Explain __init__ method with an example python program.
7) Explain __str__ method with an example python program.
8) Illustrate pure functions with example python program.
9) Illustrate modifiers with example python program.
10) Develop a program that uses class Student which prompts the user to enter marks in three
subjects and calculates total marks, percentage and displays the score card details. [Hint: Use
list to store the marks in three subjects and total marks. Use init () method to initialize name,
USN and the lists to store marks and total, Use getMarks() method to read marks into the
list,and display() method to display the score card details.]
11) Define a function which takes TWO objects representing complex numbers and returns new
complex number with a addition of two complex numbers. Define a suitable class ‘Complex’
to represent the complex number. Develop a program to read N (N >=2) complex numbers
and to compute the addition of N complex numbers.

You might also like