Is str() a method or function?


Is str() a method or function?

The first Python lesson on "str()" ( calls it a method:

"The Now let's look at str(), which is a little less straightforward. The str() method turns non-strings into strings!"

But the docs at list it as a function.

I know that methods are just functions that are called using the attribute notation, and who knows how all this works under the hood.

The code required to solve this problem is:


What's the most correct way to refer to that code: method or function?





If you use google search
== discussions / opinions ==
python function vs method


I think It Is a method because in
the last course of the unit, you w
-ill see that it is one of the three
ways to form a string; str(), "", and ,''.


@markliami, @hiersd

Have a look at the documentation.....


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.