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]

Python intermediate | 03-Type Checking

Type Checking/Annotations in Python

Type Checking/Annotations in Python

  • Type Annotations are a new feature added in PEP 484 that allow for adding type hints to variables.
  • They are used to inform someone reading the code what the type of a variable should be.
  • This brings a sense of statically typed control to the dynamically typed Python
  • Usage
    • Annotate Argument
    • Annotate Return type
    • Annotate Variable
[Read More]