In sorted(list(mydict.keys())), sorted and list doesn’t need an object prefix someobject., but keys() needed dict1.. When, or for what functions, is the prefix necessary?
In sorted(list(mydict.keys())) , sorted and list doesn’t need an object prefix someobject. , but
Share
Methods need to be called on a specific object. Functions don’t.
The functions that are available at any time are the built-in ones, such as
sortedandlist, plus any functions that are in modules that you’ve imported or that you’ve defined yourself. The methods that are available on a particular object are the ones that are defined on that object’s type.