def get_books_by_years(start_year, end_year, books_list):
  """
  Get a dictionary of books and their published based on a range of year

  Parameters:
    start_year: The lower bound of the search range.
    end_year: The upper bound of the search range.
    books_list: The list of books to search in
  Returns:
    books_with_years: A dictionary of books with their publised year.
  """
  print("You search for books published from " + str(start_year) + " to " + str(end_year))

  books_with_years = {}
  for book in books_list:
    if book["published_year"] >= int(start_year) and book["published_year"] <= int(end_year):
      books_with_years[book["title"]] = book["published_year"]
  return books_with_years