I am working on the official Django tutorial at https://docs.djangoproject.com/en/1.10/intro/tutorial03/ . I am unable to understand this line. Could someone please break it down for me?
def index(request):
latest_question_list = Question.objects.order_by('-pub_date')[:5]
output = ', '.join([q.question_text for q in latest_question_list])
return HttpResponse(output)
EDIT: A user said that this is not a single line of code. The way the code is formatted makes it unclear because they used a large font and often broke down down single lines into multiple lines. Here is the way it was formatted on the website:
Question.objects.order_by('-pub_date')[:5]
output = ', '.join([q.question_text for q
in latest_question_list])
The output line was indented, which led me to believe that it was part of the same line, but for some reason Stack Overflow won't let me do that.