Q. Which function is used to get a model object or return 404 if not found?
β
Correct Answer: (B)
get_object_or_404
Explanation: get_object_or_404 retrieves a model instance or raises Http404 if it doesn’t exist.