Python Archive
split(): It is used to split the input string into tokens. It returns list of tokens. We utilize maxsplit option as follows
compile(): A function belongs to “re” module. It is used to construct the “pattern object”. When we use a pattern repeatedly to extract the data, it is recommended to construct the pattern object using compile(). …
Extract data using symbols: We can create expressions using symbols. To extract the data, we use symbols and operators in regular expressions. Split the string into characters: Using dot(.) as a raw string, we can …
Set of digits extraction: Extracting date from input: Extract Mail IDs: Only domain names excluding @: Only domain types: Any five letter string starting with ‘a’ and end with ‘s’: Output: findall() returns a list …
Modules in Python: Python application is a collection of modules. Module is a python source file(.py) Application a collection of program files(called modules) Python library providing number of pre-defined modules Some of the modules contain …
Creating User module: In our previous concepts, we have written the complete code in a single source file. If the code is large, it is complex to analyze, understand and debug the code. Large programs …
from: It is a keyword. It is used to access one or more classes from the specified module. Note that, no need to specify the module name along with class name if we import using …
Packages: package is a directory or folder. Application is a collection of packages. package is a collection of modules package contains related python source files called modules. Every module contains classes, variables and functions. Accessing …
Garbage Collection: Python is fully Object Oriented Programming Language. In OOP application, data stores in the form of Objects. We access the objects information using references. Garbage collection is the mechanism of deleting unreferenced objects. …
Inner Class: Defining a class inside another class is called Inner class. Inner classes also called Neted classes. Inner classes clearly having two benefits. Inner classes are used to set dependencies on objects. We need …