Home »
Python »
Django MCQs
What is the correct syntax to use a variable in the Django template?
17. What is the correct syntax to use a variable in the Django template?
- {{ variable_name }}
- < variable_name >
- << variable_name >>
- " variable_name "
Answer: A) {{ variable_name }}
Explanation:
If you want to use a variable in the Django template, you need to follow the below-given syntax:
{{ variable_name }}
Let's suppose there is a variable named "email", and you want to use it inside a Django template. Then you have to write it inside the double curly opening and closing braces.