top of page

Python Tutorial

Public·1 member

Basic Syntax and Patterns

In this lesson, we will cover the fundamental building blocks and common patterns.


Basic Elements:


  1. Literal Characters:

  • A regular expression can consist of literal characters that match exactly. For example, the regex `python` will match the string "python" in a text.

  1. Character Classes:

  • Character classes are enclosed in square brackets ([]) and allow you to match any one of the characters within the brackets. For instance, `[aeiou]` matches any vowel.


9 Views

Introduction to Regular Expressions

Regular expressions (regex or regexp) are powerful and concise sequences of characters that define search patterns. They serve as a flexible tool for text processing, allowing you to describe and match complex patterns within strings. Regular expressions are widely used in programming, data validation, text manipulation, and search operations.


Key Concepts:

  1. Pattern Matching:

  • At its core, a regular expression is a pattern that describes a set of strings. It allows you to search for, match, and manipulate text based on this pattern.

  1. Text Search and Manipulation:

  • Regular expressions provide a way to search for specific sequences of characters, validate input formats, replace text, and extract information from strings.


9 Views

Python For Loop

A for loop is used for iterating over a sequence.

Sequence in python may be:

  • list

  • tuple

  • dictionary

  • set


11 Views

Sorting List in Python | sort() In Python

Python list sort()

The sort function can be used to sort a list in ascending, descending or user defined order.


Sorting list of integer in python

Example 1:

sorting list of integer in ascending order.


199 Views
bottom of page