Jan-19-2024, 07:58 AM
(Jan-18-2024, 10:59 AM)perfringo Wrote:(Jan-18-2024, 06:48 AM)akbarza Wrote: how can I see all attributes and methods related to a special type? for example, I want to see all methods and attributes related to lists, how can I do it?
For that there is the documentation. However, Python's interactive interpreter has helpful feature as well:
>>> list. # press two times TAB list.append( list.clear( list.copy( list.count( list.extend( list.index( list.insert( list.mro() list.pop( list.remove( list.reverse( list.sort( >>> help(list.count) Help on method_descriptor: count(self, value, /) Return number of occurrences of value. # works on instances as well: >>> spam = [1, 2] >>> spam. # two times TAB spam.append( spam.clear() spam.copy() spam.count( spam.extend( spam.index( spam.insert( spam.pop( spam.remove( spam.reverse() spam.sort(
thanks for reply
In IDLE, I typed list. and then pressed the tab key twice, it became list. and popped up a small window that contained all methods related to the list type. I tried several times, but I was not successful. also, I did it for spam ( as you have defined), but again I was not successful. what is the problem?