Author name: Siliveri Sriharshini

Python Regular Expressions (RegEx) with examples

Regular Expressions (regex) are patterns used to match character combinations in strings. Let’s go through some examples using Python’s re module. Importing the re module: import re   Basic Match: pattern = r”hello” text = “hello world” match = re.search(pattern, text) if match: print(“Found:”, match.group())   .: Matches any character except newline. ^: Matches the …

Python Regular Expressions (RegEx) with examples Read More »

Python Naming Convention

Python naming conventions are guidelines that help ensure consistency and readability in Python code. They are part of PEP 8, the Python Enhancement Proposal that outlines coding standards for Python. Here are the key conventions: Naming Conventions for Different Elements Variables and Functions: Use lowercase letters and separate words with underscores (snake_case). Example: my_variable, calculate_area() …

Python Naming Convention Read More »

Scroll to Top