04-Python intermediate

Regular expression in Pthon

4. Regular expression

  • A Regular Expression (RegEx) is a sequence of characters that defines a search pattern
  • RegEx can be used to check if a string contains the specified search pattern.
  • Python has a built-in package called re, which can be used to work with Regular Expressions.

If we want to represent a group of Strings according to a particular format/pattern then we should go for Regular Expressions.

[Read More]

02-Python intermediate

File Handling, File operation in Python

2. File Handling

As the part of programming requirement, we have to store our data permanently for future purpose. For this requirement we should go for files.

Files are very common permanent storage areas to store our data.

There are 2 types of file

  • Text Files
    • Usually we can use text files to store character data
  • Binary Files
    • Usually we can use binary files to store binary data like images,video files, audio files etc..
[Read More]

08-Python Basic

Dictionary and dictionary operations

8. Dictionary Data Structure

Dictionaries are used to store data values in key-value pairs

  • Duplicate keys are not allowed but values can be duplicated.
  • Hetrogeneous objects are allowed for both key and values.
  • Insertion order is not preserved
  • Dictionaries are mutable
  • Indexing and slicing concepts are not applicable

As of Python version 3.7, dictionaries are ordered. In Python 3.6 and earlier, dictionaries are unordered.

[Read More]

09-Python Basic

Functions, Parameters, Arguments, Generator, Iterator

9. Functions

If a group of statements is repeatedly required then it is not recommended to write these statements everytime separately.

We have to define these statements as a single unit, and we can call that unit any number of times based on our requirement without rewriting. This unit is nothing but function.

  • The main advantage of functions is code Reusability.
  • Python supports 2 types of functions
    1. Built-in Functions
    2. User Defined Functions
[Read More]

07-Python Basic

Python Tuple and Set data types

7.1 Tuple Data Structure

Tuple is exactly same as List except that it is immutable. i.e once we creates Tuple object,we cannot perform any changes in that object. Hence Tuple is Read Only version of List.

  • Tuple are immutable and insertion order is preserved
  • Duplicates and Heterogeneous objects are allowed
[Read More]

06-Python Basic

Python list data types

6 List Data Structure

List is used when we want to represent a group of values as a single entity where insertion order required to preserve and duplicates are allowed then we should go for list data type

  • List is one of the most frequently used and very versatile data types used in Python.
  • List items are ordered, mutable, heterogeneous and allow duplicate values.
  • List items are indexed, the first item has index [0], the second item has index [1] etc.
[Read More]