string contains... Uppercase letters Lowercase letters Vowels Consonants Spaces • Python is an Object Oriented Programming language. • Classes and Objects are the key features of Object Oriented Programming. • In Python, a class is defined by using the keyword class.
• Variables defined inside a class is called as “Class Variable” and function are called as “Methods”. • The process of creating object is called as “Class Instantiation”. • Constructor is the special function that is automatically executed when an object of a class is created. • In Python, there is a special function called “init” is used as Constructor.
• Destructor is also a special method gets execution automatically when an object exits from the scope. • In Python, ( ) method is used as destructor. • A variable prefixed with double underscore is becomes private in nature. Points to remember 12th Computer Chapter - - Python Classes and Objects Hands on Experience .
Write a program using class to store name and marks of students in list and print total marks. . Write a program using class to accept three sides of a triangle and print its area. .
Write a menu driven program to read, display, add and subtract two distances.