Regular Expression ( Regex ) in Python : Python tutorial 26

What is a regular expression : A regular expression is a sequence of characters that represents a search pattern. Using regular expression, we can check if a sub- string of that expression type exist or not, if exist than replace it with another string etc. One great thing about regular expression is that the syntax

Python class and objects : Python tutorial 24

Python classes and objects : Python is a “object oriented” programming language. In simple words, classes are templates for the objects , and objects are collection of variables and functions. Defining classes in python : Class definition looks like : class ClassName : statements Similar to functions, class definitions should execute at first before running.

Python Exception : Python Tutorial 23

Python Exception : What is an Exception : Exceptions are errors that raised during execution time. That means your statement is correct but during execution time , it was trying to run a statement that cannot be done . Let’s take an example on a python exception : for i in range(5,-1,-1): print 5/i Output

Python File operations : Python Tutorial 21

Python File operations : Open, Close, Read , Write and Append to a file in Python : Python has functions and methods to manipulate files . No external library is required for doing file operations in python. In this tutorial, we will learn different python file operations like reading the content of a file, writing

Python Package : Python Tutorial 19

Python Package : What is a python package ? In simple words , python packages are directories containing python files. We love to arrange files in our computer in different directories, like all movies in a “movie” folder or all songs in a “songs” folder etc. So, what is the use of using packages ?

Python Module : Python tutorial 18

Python Module : A python module is simply a python file ( .py file ) with definitions and statements. The file name is the module name. After creating a module, we can use it any other module using “import” command.  Module is useful for re-usability of the code. You can write one function in one

Python anonymous or lambda function : Python Tutorial 17

Python anonymous or lambda function : Anonymous or lambda functions are functions without a name. In python, we can create an anonymous function using a construct called “lambda” unlike “def” keyword we use to create other functions.  Difference between normal function and lambda function : def function1(x) : return x ** x function2 = lambda