Python Example
- Previous Page Reverse String
- Next Page Python Quiz
Python Syntax
Python Variables
Python Numbers
Python Casting
Python Strings
- Get the character at position 1 of the string
- Substring. Get the characters from position 2 to position 5 (excluding)
- Removing leading or trailing spaces from a string
- Returning the length of a string
- Converting a string to lowercase
- Converting a string to uppercase
- Replacing a string with another string
- Splitting a string into substrings
Python Operators
Python Lists
- Creating a list
- Accessing an item in a list
- Changing the value of an item in a list
- Traversing a list
- Checking if an item exists in a list
- Getting the length of a list
- Adding an item to the end of a list
- Adding an item to a specified index
- Deleting an item
- Deleting the last item
- Deleting an item at a specified index
- Clearing a list
- Generating a list using the list() constructor
Python Tuples
Python Sets
- Create Collection
- Traversing a set
- Checking if an item exists in a set
- Adding an item to a set
- Adding multiple items to a set
- Getting the length of a set
- Deleting an item from a set
- Deleting an item from a set using discard() method
- Deleting the last item in a set using pop() method
- Clearing a set
- Delete Collection
- Creating a set using the set() constructor
Python Dictionaries
- Creating a dictionary
- Accessing an item in a dictionary
- Changing the value of a specific item in a dictionary
- Printing all key names in the dictionary one by one
- Printing all values in the dictionary one by one
- Returning the values of a dictionary using values() function
- Traversing keys and values using items()
- Checking if a key exists in a dictionary
- Getting the length of a dictionary
- Adding an item to a dictionary
- Deleting an item from a dictionary
- Clearing a dictionary
- Creating a dictionary using the dict() constructor
Python If ... Else
Python While Loop
Python For Loop
Python Functions
Python Lambda
Python Arrays
Python Classes and Objects
Python Iterators
Python Modules
Python Date
Python JSON
- Convert JSON to Python
- Convert Python to JSON
- Convert a Python object to a JSON string
- Convert a Python object containing all valid data types
- Use the indent parameter to define the indentation amount
- Use the separators parameter to change the default separator
- Use the sort_keys parameter to specify whether the result should be sorted
Python RegEx
Python Try Except
Python file
Python MySQL
- Create a connection with the database
- Create a database in MySQL
- Check if Database Exists
- Create a table
- Check if the table exists
- Create a primary key when creating a table
- Insert Records into Table
- Insert Multiple Rows
- Get the Inserted ID
- Select All Records from Table
- Select Certain Columns from Table
- Read a Single Row from Table Using fetchone() Method
- Select Using Filters
- Wildcard
- Prevent SQL Injection
- Sort Results in Alphabetical Order
- Sort Results in Descending Order (Reverse Alphabetical Order)
- Delete Records from Existing Table
- Prevent SQL Injection
- Delete Existing Table
- Delete Table If It Exists
- Update Existing Records in Table
- Prevent SQL Injection
- Limit the Number of Records Returned by the Query
- Merge Rows Based on Related Columns Between Two or More Tables
- Left Join (LEFT JOIN)
- Right Join (RIGHT JOIN)
Python MongoDB
- Create Database
- Check if Database Exists
- Create Collection
- Check if Collection Exists
- Insert Collection
- Return ID Field
- Insert Multiple Documents
- Insert Multiple Documents with Specified ID
- Find the First Document in Collection
- Find All Documents in Collection
- Search Only Certain Fields
- Filter Results
- Advanced Query
- Filter Using Regular Expressions
- Sort Results in Alphabetical Order
- Sort Results in Descending Order (Reverse Alphabetical Order)
- Delete Document
- Delete Multiple Documents
- Delete All Documents in Collection
- Delete Collection
- Update Document
- Update Multiple/All Documents
- Limit Results
- Previous Page Reverse String
- Next Page Python Quiz