<|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
Create a program that extracts the first and last names from a string.
Full Name: "Barack Obama"<|im_end|>
<|im_start|>assistant
def extract_names(full_name):
  #Split the name into separate words
  name_parts = full_name.split()
  
  #Check if the name has multiple words
  if len(name_parts) == 1:
    return None
  
  #Extract the first and last names
  first_name = name_parts[0]
  last_name = name_parts[-1]
  
  #Return the first and last names
  return first_name, last_name

print(extract_names("Barack Obama"))

Output:
('Barack', 'Obama')<|im_end|>
