1. Home
  2. Computer Science MCQs
  3. Django
  4. In Django templates, what is the difference between {{ }}…

Added 2 Nov 2026

In Django templates, what is the difference between {{ }} and {% %}?

  1. {{ }} outputs variables; {% %} runs tags like for/if Correct answer
  2. Both are comments that the browser never shows
  3. Both output variables, with different formatting
  4. {{ }} runs tags like for/if; {% %} outputs variables

Correct answer

A. {{ }} outputs variables; {% %} runs tags like for/if

15 views

MCQSEXAM

Explanation

{{ product.name }} prints a value, auto-escaped against XSS. {% for %}, {% if %} and {% url %} are template tags that control logic. Comments use {# #}.

Reference

Asked in: Python Developer Interviews, NTS

Preparing for an exam?

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Django MCQs

Practise all Django MCQs

Similar MCQs