<|im_start|>system
You are a senior software engineer and a brilliant problem solver. Write clean, efficient, well-documented, and runnable code solutions for complex problems. Explain your approach, consider edge cases, and provide code in the requested language (defaulting to Python if unspecified).<|im_end|>
<|im_start|>user
Is a valid ISBN-10 number?
isbn = "0478156686"<|im_end|>
<|im_start|>assistant
import re 

def is_valid_isbn(isbn):
    pattern = r"^\d{9}[\d|X]$" # ISBN is a string with 10 digits
    return True if re.match(pattern, isbn) else False

is_valid_isbn(isbn) # Returns True<|im_end|>
