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

Assignment Module 5

The document outlines a module for an Introduction to Python Programming course at Basaveshwar Engineering College, focusing on key concepts such as class methods, program development concepts, and object-oriented programming. It includes tasks like defining a Complex class for complex number addition, creating a Time class, and explaining class definitions, inheritance, and copying. The document serves as a guide for students to understand and implement various programming concepts in Python.
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)
7 views1 page

Assignment Module 5

The document outlines a module for an Introduction to Python Programming course at Basaveshwar Engineering College, focusing on key concepts such as class methods, program development concepts, and object-oriented programming. It includes tasks like defining a Complex class for complex number addition, creating a Time class, and explaining class definitions, inheritance, and copying. The document serves as a guide for students to understand and implement various programming concepts in Python.
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

Basaveshwar Engineering College, Bagalkote

Department of Electrical and Electronics Engineering


Subject : Introduction to Python Programming Subject Code :
Faculty Name : Mr. Mahantesh Chikkadesai Semester : 3

Module-5
1. Explain the methods __init__ and __str__ with suitable code example to each.
2. Explain the program development concept ‘prototype and patch’ with suitable
example.
3. 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.
4. Explain the following with syntax and suitable code snippet: i) Class definition ii)
instantiation iii) passing an instance (or objects) as an argument iv) instances as return
values.
5. Define pure function and modifier. Explain the role of pure functions and modifiers in
application development with suitable python programs.
6. create a Time class with hour, min and sec as attributes. Demonstrate how two Time
objects would be added.
7. What is a class? How to define a class in python? How to initiate a class and how the
class members are accessed? Explain with programming snippets
8. Define a class and object, construct the class called rectangle and initialize it with
height 100, width=200, starting point as (x = 0, y = 0). Write a program to display the
center point co-ordinates of a rectangle.
9. Explain the concept of copying using copy module with an example.
10. Explain the concept of inheritance with an example.
11. Briefly explain the printing of objects with an examples.

You might also like