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]

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]

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]

03-Python Advance

Deepcopy and shallow copy

Deepcopy and Shallow copy

  • In case of shallow copy, a reference of object is copied in other object.
    • It means that any changes made to the copied object do reflect in the original object
    • External object id changes but Internal object id remains same
  • In case of deep copy, a copy of object is copied in other object.
    • It means that any changes made to the copied object do not reflect in the original object
    • External and internal object ids changes
[Read More]