Lecture notes on object oriented programming pdf




















All the questions given below will help the students get an idea of the question paper pattern. There are many topics that students will be learning, and each unit will earn different topics. Briefly explain the principles of Object Oriented Programming. Explain its components.

What are monolithic, procedural, and structural programming languages? Briefly state their drawbacks. Define polymorphism. Describe using suitable examples. Write a short note on generic programming. What are the function templates? Explain in detail. Special functions are invoked automatically. Python types such as lists, tuples, strings, sets, dictionary are all examples of inbuilt iterators and are all iterable. Objects which act as iterators must implement the following methods:.

This will return an object that is iterable. Used to manually iterate through all items of an iterator. When we reach the end and no more data is returned, the method will raise an exception called StopIteration. The above method is the manual method of using iteration. The same can be achieved using a for in loop as shown below:. Building of user defined iterations leads to additional overheads like we need to define a class with iter and next methods, keep tracks of the states, raise StopIterations etc.

Python Generators are simple ways of creating iterators. All the additional overheads are automatically handled by Generators. A generator is a function which returns an iterator object with which we can iterate over one value at a time. Generators is a normal function with yiel statement instead of a return statement.

If a function has an yield statement it becomes an Generator Function. Both yield and return returns some value from a function. Multiple yield can be part of Generator function but only one yield can be executed returning a single value at a time. The difference between return and yield is that return statement terminates a function entirely whereas yield statement pauses the function, saving the current states and returns to the paused function during a successful call.

Python Decorators: Decorators are used to add additional functionality to an existing function. Decorators take in a function, adds some functionality and returns it. Open navigation menu. Close suggestions Search Search. User Settings. Skip carousel. Carousel Previous. Carousel Next. What is Scribd? Explore Ebooks. Bestsellers Editors' Picks All Ebooks. Explore Audiobooks.

Bestsellers Editors' Picks All audiobooks. Explore Magazines. Editors' Picks All magazines. Explore Podcasts All podcasts. Difficulty Beginner Intermediate Advanced. Explore Documents. Uploaded by Kanak. Did you find this document useful? Is this content inappropriate? Report this Document. Flag for inappropriate content.

Save Save Notes For Later. Related titles. Carousel Previous Carousel Next. Jump to Page. Search inside document. Inheritace: Inheritance is a feature of class which refers to creating a new class from an already existing class. Types of Inheritance: 1 Single Inheritance: Creating a single derived class out of a single base class is called single inheritance. Base2 : properties of derived The derived class under multiple inheritance contains properties of its own, plus properties of Base1 followed by Base2.



0コメント

  • 1000 / 1000