input: Write a python function to validate ISBN-10 numbers.
  assert is_isbn_valid("0-306-40615-2") == True
  assert is_isbn_valid("0-306-40615-X") == False
  assert is_isbn_valid("123456789X") == True
  assert is_isbn_valid("1234567890") == False
output: def is_isbn_valid(isbn):
      isbn = isbn.replace("-", "")
      if len(isbn) != 10:
          return False
      
      total = 0
      for i, char in enumerate(isbn):
          if char == 'X':
              if i != 9:
                  return False
              total += 10 * (i + 1)
          elif char.isdigit():
              total += int(char) * (i + 1)
          else:
              return False
      
      return total % 11 == 0