Python Language Python speed of program Notation

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

Basic Idea

The notation used when describing the speed of your Python program is called Big-O notation. Let's say you have a function:

def list_check(to_check, the_list):
    for item in the_list:
        if to_check == item:
          return True
    return False

This is a simple function to check if an item is in a list. To describe the complexity of this function, you will say O(n). This means "Order of n" as the O function is known as the Order function.

O(n) - generally n is the number of items in container

O(k) - generally k is the value of the parameter or the number of elements in the parameter



Got any Python Language Question?