A Python function is a block of code that may take one or more input parameters, executes and may return a value. Functions can be used in Python programs repeatedly.
Python provides the find() method to search in a given string. The Python string find method searches through the whole string, by default, to search for given characters or word and returns the index of the first occurrence.
The Exception is an object in Python that represents an error. As an error occurs in a program, Python generates an exception. To avoid crashing a program, this error should be handled.
Python comes up with a built-in function open() that enables programmers to perform open, read, write and other operations with files.
Python Strings are the sequence of characters. Strings are enclosed in single or double quotes. That means Python will treat single or double quoted strings alike.
Python provides a data type dictionary (or dict) which is just like the associative arrays in some other languages. The Dictionary data types work with key – value pairs.
The Arrays are similar to Python list. However, the difference is a list can hold multi-type elements whereas the arrays can hold only single type e.g. an array of only strings or numbers.
The append method of Python adds or appends an element to the existing list. Python extend method also appends given to existing list.
The List is among the compound datatypes available in Python. Other compound data types like Tuple and Dict are explained in their respective chapters. Among the other compound data types, the List is the most versatile.
The if Python statement is used when you have just one condition to check. If the condition evaluates as true, it will execute the given statements.