Human: What is a good Python function to count whitespace characters? What is python's good function to count the whitespace characters in Python. Assistant: 
Here is a Python function to count whitespace characters

import re

def count_whitespace(string):
    """
    Count the number of whitespace characters in a string.
    """
    return sum([1 for c in string if c in'\t\n\r'])

# Enter the string
string = "hello world"

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

#Example Output
# 0

#Remember to inspect code for bugs.