Python Forum
help() and dir() functions in Python.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
help() and dir() functions in Python.
#2
help() docs

Output:
>>> help(print) Help on built-in function print in module builtins: print(...) print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False) Prints the values to a stream, or to sys.stdout by default. Optional keyword arguments: file: a file-like object (stream); defaults to the current sys.stdout. sep: string inserted between values, default a space. end: string appended after the last value, default a newline. flush: whether to forcibly flush the stream.
dir() docs

Output:
>>> dir(str) ['__add__', '__class__', '__contains__', '__delattr__', '__dir__', '__doc__', '_ _eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs __', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__' , '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__', '__sizeof__' , '__str__', '__subclasshook__', 'capitalize', 'casefold', 'center', 'count', 'e ncode', 'endswith', 'expandtabs', 'find', 'format', 'format_map', 'index', 'isal num', 'isalpha', 'isascii', 'isdecimal', 'isdigit', 'isidentifier', 'islower', ' isnumeric', 'isprintable', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lo wer', 'lstrip', 'maketrans', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill'] >>>
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
help() and dir() functions in Python. - by rinu - Feb-05-2019, 11:59 AM
RE: help() and dir() functions in Python. - by buran - Feb-05-2019, 02:12 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020