Home > Mobile >  Are Python classes returning value methods?
Are Python classes returning value methods?

Time:03-16

Is a class in Python a returning value method?

I was given the following question:

"Which of the following represents a template, blueprint, or contract that defines objects of the same type?: class definition, a returning value method, class instance, or none of the above"

I know that a class is a blueprint that defines objects of the same type but I'm not sure if a class is a returning value method.

CodePudding user response:

A returning value method is only one of the options, the actual question never says anything about them.

Regarding your original question, I would say a Python class is a returning value method, but a returning value method is not a Python class. A class in Python does return a value, the object that's being created through that class, but returning value methods (like functions) are not blueprints for objects.

  • Related