A

Admin • 828.03K Points
Coach

Q. Which function is used in Django models to define a string representation?

  • (A) __print__
  • (B) __str__
  • (C) __name__
  • (D) __display__
  • Correct Answer - Option(B)
  • Views: 11
  • Filed under category Django
  • Hashtags:

Explanation by: Admin
The `__str__` method in models defines the string representation of an object.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.