The document provides a list of 24 assignment questions related to object-oriented programming concepts in Python. Some of the key concepts covered in the questions include:
1. Defining classes and objects in Python with examples.
2. Explaining attributes and demonstrating them with an object diagram example.
3. Overloading operators like + in Python by defining special methods.
4. Implementing inheritance by creating subclasses that extend existing classes.
5. Using class diagrams to illustrate relationships between classes.
The questions ask students to write code snippets and programs to demonstrate their understanding of these fundamental OOP concepts in Python.
The document provides a list of 24 assignment questions related to object-oriented programming concepts in Python. Some of the key concepts covered in the questions include:
1. Defining classes and objects in Python with examples.
2. Explaining attributes and demonstrating them with an object diagram example.
3. Overloading operators like + in Python by defining special methods.
4. Implementing inheritance by creating subclasses that extend existing classes.
5. Using class diagrams to illustrate relationships between classes.
The questions ask students to write code snippets and programs to demonstrate their understanding of these fundamental OOP concepts in Python.
The document provides a list of 24 assignment questions related to object-oriented programming concepts in Python. Some of the key concepts covered in the questions include:
1. Defining classes and objects in Python with examples.
2. Explaining attributes and demonstrating them with an object diagram example.
3. Overloading operators like + in Python by defining special methods.
4. Implementing inheritance by creating subclasses that extend existing classes.
5. Using class diagrams to illustrate relationships between classes.
The questions ask students to write code snippets and programs to demonstrate their understanding of these fundamental OOP concepts in Python.
Module – 4 Note: Prepare first 17 questions for internal
1. List out the object oriented characteristics possessed by Python.
2. Define class and object. Give an example for creating a class and an object of that class. 3. What are attributes? Explain with an example and respective object diagram. 4. Build a class called Point with two attributes x and y. Write following functions and demonstrate the working of these functions by creating suitable objects. a. To read attribute values b. To display point as an ordered pair c. To find distance between two points 5. Write a program to create a class called Rectangle with the help of a corner point, width and height. Write following functions and demonstrate their working: a. To find and display center of rectangle b. To resize the rectangle 6. Differentiate copy.copy( ) and copy.deepcopy( ) with suitable examples. 7. Write a program to create a class called time and read the attributes for time class. 8. Differentiate between pure functions and modifiers with suitable examples 9. Explain prototype development versus planning. 10.Discuss the significance of __init__( ) method in Python with a proper example code snippet. 11.Briefly discuss self-keyword in Python with a proper example code snippet. 12.What does __str__( ) method do in Python? Illustrate with a code snippet. 13.Discuss operator overloading. Mention any five operators with respective special functions to be overloaded in Python. 14.develop a program to add two point objects by using overloading + operator 15.Write a program to create a class Time to represent time in HH:MM:SS format. Perform following operations: a. Overload + to add two time objects b. Overload + to add a numeric value to a time object (commutative) 16.Explain type-based dispatch operation in python with example? 17. Define polymorphism? Explain with an example program. 18. Explain interface and implementation. 19.Create an object for playing cards and display the specified card 20.Compare two cards by using __it__ method. 21.Explain class diagram with suitable example. 22.Create an object for Deck class and display all the cards 23.Define inheritance. Write codes to Hand class which inherits Deck class and perform the following i>To add a card to Hand object ii>Move a card from one hand to another. 24.What do you mean by class diagram. Explain the relationship between classes with example.