Thanks to visit codestin.com
Credit goes to www.scribd.com

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

Python Module 5 and 4

The document outlines key concepts in Python programming, focusing on debugging, exception handling, logging, and class definitions. It covers raising exceptions, assertions, logging levels, and the benefits of the logging module, along with detailed explanations of class structures, object printing, and operator overloading. Additionally, it includes practical programming tasks such as creating a rectangle class and manipulating complex numbers.
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)
29 views1 page

Python Module 5 and 4

The document outlines key concepts in Python programming, focusing on debugging, exception handling, logging, and class definitions. It covers raising exceptions, assertions, logging levels, and the benefits of the logging module, along with detailed explanations of class structures, object printing, and operator overloading. Additionally, it includes practical programming tasks such as creating a rectangle class and manipulating complex numbers.
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

Python (BPLCK205B)

Module 4 (chapter : Debugging )


1. Write a note on Raising exceptions in python.
2. Explain the role of Assertions in python with a suitable program.
3. Briefly explain Assertions and Raising Exceptions.
4. Illustrate the logging levels in python.
5. Describe the logging levels used in python to categorize log messages by
importance.
6. Explain the support for Logging with logging module in python.
7. List out the benefits of using logging module with an example.
8. Explain five buttons available in the Debug Control window.

Module 5
1. What is class? How to define class in Python? How to initiate a class and
how the class members are accessed?
2. Briefly explain the printing of objects with an example.
3. Explain __init__() and __str__() method with examples.
4. Explain pure function and modifier function with example
5. Define pure function. Illustrate with an example Python program.
6. Explain the concept of copying using copy module with an example.
7. Define operator overloading. Explain the operator overloading to perform
addition of two objects in Python.
8. Define a class and object, construct the class called rectangle and initialise
it with height=100, width=200, starting point as (x=0,y=0). Write a program
to display the centre point co-ordinates of the rectangle.
9. Write a program to implement the following object diagram and its
functionalities as shown in the fig. Initialize the attributes through a
constructor and print the same.

10. Define a function which takes two objects representing complex numbers
and return new complex number with a addition of two complex numbers.
Define a suitable to read (N>=2) complex numbers and to compute the
addition of N complex numbers.

You might also like