human
Give me a Python code to count leading whitespace in a string.
assistant
Here is a Python code to count leading whitespace in a string

import re

def count_leading_whitespace(s):
    """Returns the number of leading whitespace in a string."""
    return len(re.sub(r'\s+', '', s))

# Enter the string
string = "hello world"

# Calling the function
print((count_leading_whitespace(string)))

#Example Output
# 10

#Remember to inspect code for bugs.