Posts

Showing posts with the label python

DATA TYPES IN PYTHON

Image
 Data types in python          S tring          I nteger          F loat          C omplex          L ist          T uple          R ange          D ictionary          S et           B oolean String:                     strings are using single quotation, double quotation and three quotation. Example: #string x= "codeco" print ( type (x)) Output : <class 'str'> Integer:                    I nteger is a numeric type Example: #integer x= 232323 print ( type (x)) Output: <class 'int'> Float:               I t is similar to integer datatype but with decimal values. Exampl...

Object-oriented programming (OOPs)-python

 OOPs Concepts:                  An object-oriented programming is to design the program using classes and objects.     The object is related to real-word entities such as book, house, pencil, etc.     OOPs concept code writing is reusable code Principles of OOPs:                  C lass       Object       Method       Inheritance       Polymorphism       Data Abstraction       Encapsulation Class:         Class can be define as collection of object. The class have some specific attributes and methods.   For example: If you have school class, The it must contain an attribute and method     i.e an student name,roll num,email id,age, DOB Example:               ...