Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 help() and dir() functions in Python.
#1
can anyone explain with example help() and dir() functions in Python.
Quote
#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'] >>>
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  How to plot implicit functions (with two variables) in scipy python using matplotlib? Jay_Nerella 1 146 May-11-2019, 01:17 AM
Last Post: scidam
  How to recognize, what functions are filled in of the Python interpreter stack? AlekseyPython 3 190 Mar-13-2019, 12:14 PM
Last Post: AlekseyPython
  Call functions recursively in tree structure using python dubru 1 198 Feb-15-2019, 06:43 PM
Last Post: nilamo
  Time multiple functions within functions Cortessizzz 4 388 Jan-09-2019, 04:15 PM
Last Post: Cortessizzz
  Functions in Python NLittle17 1 273 Jan-05-2019, 11:41 PM
Last Post: ichabod801
  Conversion of Oracle PL/SQL(packages, functions, procedures) to python modules. DivyaKumar 1 357 Dec-26-2018, 10:24 AM
Last Post: Larz60+
  setting parameters for functions and nested functions mepyyeti 5 872 Feb-25-2018, 06:42 PM
Last Post: snippsat
  Python Classes or Functions for large scale application ? Vithulan 5 1,394 Oct-23-2017, 04:48 PM
Last Post: Larz60+
  Problems with Interrupts/ callback functions in Python for an Alarm Clock project Henry1 1 1,991 Dec-16-2016, 10:17 PM
Last Post: nilamo

Forum Jump:


Users browsing this thread: 1 Guest(s)