Q. What does `{{ variable|default:'N/A' }}` do in Django templates?

  • (A) Sets a variable
  • (B) Deletes a variable
  • (C) Displays N/A if variable is undefined
  • (D) Imports default module
πŸ’¬ Discuss
βœ… Correct Answer: (C) Displays N/A if variable is undefined
Explanation: The `default` filter shows a default value if the variable is undefined.
Explanation by: Mr. Dubey
The `default` filter shows a default value if the variable is undefined.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
266
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
97%
Success Rate