Skip to content

Learn Python

  • Python
  • Cyber Security Basics
Learn Python
  • Python

    Escape Sequences in Python

    Byadmin July 29, 2025July 29, 2025

    Escape Sequences in Python Escape sequences are special character combinations that represent other characters or actions in strings. Here’s a complete list of Python escape sequences with two examples for each: 1. \\ – Backslash python print(“This is a backslash: \\”) # Output: This is a backslash: \ print(“Path: C:\\Users\\Name”) # Output: Path: C:\Users\Name 2. \’ – Single quote…

    Read More Escape Sequences in PythonContinue

  • Python

    ASCII ,Uni Code Related Functions in Python

    Byadmin July 28, 2025July 28, 2025

    ASCII Code and Related Functions in Python ASCII (American Standard Code for Information Interchange) is a character encoding standard that assigns numerical values to letters, digits, punctuation marks, and other characters. Here’s an explanation of ASCII and Python functions that work with it. ASCII Basics Python Functions for ASCII 1. ord() – Get ASCII value of a…

    Read More ASCII ,Uni Code Related Functions in PythonContinue

  • Python

    String Validation Methods

    Byadmin July 24, 2025July 24, 2025

    Complete List of Python String Validation Methods Python provides several built-in string methods to check if a string meets certain criteria. These methods return True or False and are useful for input validation, data cleaning, and text processing. 1. Case Checking Methods Method Description Example isupper() Checks if all characters are uppercase “HELLO”.isupper() → True islower() Checks if all…

    Read More String Validation MethodsContinue

  • Case Conversion Methods in Python
    Python

    Case Conversion Methods in Python

    Byadmin July 23, 2025July 24, 2025

    Case Conversion Methods in Python (Syntax + Examples) Python provides several built-in string methods to convert text between different cases (uppercase, lowercase, title case, etc.). Below are the key methods with syntax and examples: 1. upper() – Convert to Uppercase Purpose: Converts all characters in a string to uppercase.Syntax: python string.upper() Examples: python text = “Hello, World!”…

    Read More Case Conversion Methods in PythonContinue

  • replace(), join(), split(), rsplit(), and splitlines() methods in Python
    Python

    replace(), join(), split(), rsplit(), and splitlines() methods in Python

    Byadmin July 23, 2025July 24, 2025

    1. replace() Method Purpose: Replaces occurrences of a substring with another substring.Syntax: python string.replace(old, new[, count]) Examples: Example 1: Basic Replacement python text = “Hello World” new_text = text.replace(“World”, “Python”) print(new_text) # Output: “Hello Python” Example 2: Limiting Replacements (count) python text = “apple apple apple” new_text = text.replace(“apple”, “orange”, 2) print(new_text) # Output: “orange orange apple”…

    Read More replace(), join(), split(), rsplit(), and splitlines() methods in PythonContinue

  • String Alignment and Padding in Python
    Python

    String Alignment and Padding in Python

    Byadmin July 22, 2025July 24, 2025

    String Alignment and Padding in Python In Python, you can align and pad strings to make them visually consistent in output. The main methods used for this are: 1. str.ljust(width, fillchar) Left-aligns the string and fills remaining space with a specified character (default: space). Syntax: python string.ljust(width, fillchar=’ ‘) Example: python text = “Python” print(text.ljust(10)) #…

    Read More String Alignment and Padding in PythonContinue

  • Classes and Objects in Python
    Python

    Classes and Objects in Python

    Byadmin July 22, 2025July 24, 2025

    Classes and Objects in Python What are Classes and Objects? In Python, classes and objects are fundamental concepts of object-oriented programming (OOP). Real-world Analogy Think of a class as a “cookie cutter” and objects as the “cookies” made from it. The cookie cutter defines the shape, and each cookie is an instance of that shape. 1. Using type() function The type() function returns…

    Read More Classes and Objects in PythonContinue

  • String Indexing and Slicing in Python
    Python

    String Indexing and Slicing in Python

    Byadmin July 22, 2025July 24, 2025

    String Indexing and Slicing in Python In Python, strings are sequences of characters that can be accessed using indexing and slicing operations. Here’s a comprehensive explanation with examples: Indexing Strings in Python are zero-indexed, meaning the first character has index 0. python text = “Python” Index positions: text P y t h o n 0…

    Read More String Indexing and Slicing in PythonContinue

  • Strings in Python Indexing,Traversal
    Python

    Strings in Python Indexing,Traversal

    Byadmin July 21, 2025July 24, 2025

    Strings in Python and Indexing Strings in Python are sequences of characters enclosed in single quotes (‘ ‘), double quotes (” “), or triple quotes (”’ ”’ or “”” “””). They are immutable sequences of Unicode code points used to represent text. String Characteristics Creating Strings python single_quoted = ‘Hello’ double_quoted = “World” triple_quoted = ”’This is…

    Read More Strings in Python Indexing,TraversalContinue

  • Patterns in Nested For loop || match Case Statement 17th class
    Python

    Patterns in Nested For loop || match Case Statement 17th class

    Byadmin July 21, 2025July 22, 2025

    Python Pattern Printing Using Nested For Loops 1. Right Triangle Pattern python n = 5 for i in range(1, n+1): for j in range(1, i+1): print(“*”, end=” “) print() “”” Output: * * * * * * * * * * * * * * * “”” 2. Inverted Right Triangle python n = 5…

    Read More Patterns in Nested For loop || match Case Statement 17th classContinue

Page navigation

Previous PagePrevious 1 … 12 13 14 15 16 … 19 Next PageNext

© 2025 Learn Python - WordPress Theme by Kadence WP

Scroll to top
  • Python
  • Cyber Security Basics