What is a Class? How do you create it in Python?
Class in Python?
1144
20-Jul-2018
Prakash nidhi Verma
20-Jul-2018A class is a template of code and collection of objects that has same set of attributes and behaviour. To create a class use the keyword class followed by class name beginning with an uppercase letter.
A company belongs to class called company class and can have the attributes say first-name and last-name and behaviour methods say showFullName().
Ex :
you can define a method inside a class the first argument to the method must be self where self – is a pointer to the class instance. self must be passed as an argument to the method, though the method does not take any arguments.