+ 61

Found an easy method to list all public string methods.

Nothing exciting - but didnt know before. https://code.sololearn.com/cJLVkXZN1Vlw/#py

26th Dec 2017, 11:52 AM
Oma Falk
Oma Falk - avatar
25 Answers
+ 23
Yep, one of the quizzes asks about the dir() ;)
26th Dec 2017, 1:25 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 13
yep thanks it is helpful
28th Dec 2017, 8:24 AM
John Schmidt
John Schmidt - avatar
+ 9
@kuba never understood sense of question or even answer... those days are gone (-:
26th Dec 2017, 1:27 PM
Oma Falk
Oma Falk - avatar
+ 8
Can someone explain? I don't quite understand.
29th Dec 2017, 4:15 AM
Blugon
Blugon - avatar
+ 8
@akhil it is a simple filter for methods beginning with _ or __
29th Dec 2017, 8:44 AM
Oma Falk
Oma Falk - avatar
+ 7
yes , nice logic there to list them alphabetically
28th Dec 2017, 5:41 AM
jay
+ 6
@blugon python modules and classes are organized in files(directories) at a certain level filenames are the names of the methods of a class.
29th Dec 2017, 8:23 AM
Oma Falk
Oma Falk - avatar
+ 5
@blugon thats it. Additionally protected and private methods begin with _ respectiveky __
29th Dec 2017, 8:43 AM
Oma Falk
Oma Falk - avatar
+ 4
Public string methods? Are there private string methods? Are there int methods? Are there float methods? Happy to meet you, Oma.
27th Dec 2017, 8:40 AM
Antonio Oliver
Antonio Oliver - avatar
+ 4
@Tony yes...there are private: all that beginning wirh __ yes... rhere are int change dir to int, float,.... if you need methods of itertools, first import itertools... just play with the coding
27th Dec 2017, 8:55 AM
Oma Falk
Oma Falk - avatar
+ 4
and if you substitute "a" with any num say 1 ,the output will have more functions including the public str
27th Dec 2017, 3:48 PM
m yumbong
m yumbong - avatar
+ 3
привет
28th Dec 2017, 9:08 PM
Никита
Никита - avatar
+ 3
@Lord awesome sorry dont know
4th Jan 2018, 3:35 PM
Oma Falk
Oma Falk - avatar
+ 2
@Oma Falk so this is a thing to find the files that contains the modules / classes?
29th Dec 2017, 8:40 AM
Blugon
Blugon - avatar
+ 2
OK thanks
29th Dec 2017, 8:44 AM
Blugon
Blugon - avatar
+ 2
great!
1st Jan 2018, 10:49 AM
Alex
Alex - avatar
+ 2
Useful...Buddy..
3rd Jan 2018, 1:34 PM
Mukesh
Mukesh - avatar
+ 1
is there no method in STR starting from 'a' or this method does something else?
29th Dec 2017, 8:36 AM
Akhil Manchanda
Akhil Manchanda - avatar
+ 1
перевод нужен
2nd Jan 2018, 4:14 PM
Павел
Павел - avatar
+ 1
Were iss cplusplus
4th Jan 2018, 3:05 PM
Lord Awesome
Lord Awesome - avatar