input: Write a function that converts a list of books, where each book is represented as a list containing the title, author, and number of pages, into a dictionary format. Each book in the dictionary should have keys 'title', 'author', and 'pages'. The function should return a list of these dictionaries.
  
  assert convert_to_dict([['The Hobbit', 'J.R.R. Tolkien', 295], ['The Catcher in the Rye', 'J.D. Salinger', 223]]) == [
    {'title': 'The Hobbit', 'author': 'J.R.R. Tolkien', 'pages': 295},
    {'title': 'The Catcher in the Rye', 'author': 'J.D. Salinger', 'pages': 223},
  ]
  
  assert convert_to_dict([['1984', 'George Orwell', 328]]) == [
    {'title': '1984', 'author': 'George Orwell', 'pages': 328},
  ]
  
  assert convert_to_dict([]) == []
output: def convert_to_dict(books):
      return [{'title': book[0], 'author': book[1], 'pages': book[2]} for book in books]