Level 9 : What is the purpose of a docstring in Python?

Author: bhavani | Tags: docstring | 1859+ Python FAQs | Share
version-check | methods | loop-control-statements | numeric | random-function | mutable | loop | managing-directories-with-os-and-shutil | list-slicing | operators | list-mutation | logical-operators | mathematics | operator-or | oop | list-operation | gil | encapsulation | python-module | multiprocessing | handling-missing-values-(fillna,-dropna) | overflow | variable | higher-order-function | installation | formatting-with-strftime | method | python-django | error | thread | odd-number | math-copysign | loops | print | file | python_version | for | input-function | head-and-tail | using-join()-and-is_alive()-methods | round | expand-tab | reading:-read(),-readline(),-readlines() | syntaxerror | control-statement | advanced-file-operations | binary-operation | python | numpy | type-conversion | opening-files-(open()) | built-in-function | indexing:-loc-vs-iloc | function-argument | exception-handling | print-statement | anchors-(^,-$) | name-mangling | init | bitwise-operator | integers | built-in-function | exponentiation | rollback | literal-characters-and-special-characters | binary | call | mathematical-function | function-and-scope | global-keyword | int | keyword | list-vs-tuple | application | recursion | string-slicing | parameter | filter | introduction-to-threads | asyncio-module | sys | scientific-notation | using-else-and-finally | floating-point-precision | array | frozenset | python-history | generator | format | collection | booleans | boolean | string-slicing | inherit | boolean-masking | thread-synchronization | built-in-modules | else-statement | strings | software-design | using-os-and-pathlib-modules | formal-and-actual-parameter | working-with-file-paths | while-and-for-loop | class-and-inheritance | zip | compute | string-method | directory-operations | class-and-object | append | stack | difference-between-threads-and-processes | functions | interpreter | zip-function | set | objects | thread-safe-data-structures-(queue.queue) | comparison | mapping-function | working-with-dates-and-times | tuple-methods | choice | integer | list,-set,-and-dictionary-comprehensions | basic | list-methods-and-slicing | list-comprehension | set-operation | version | functional-programming | multiple-except-blocks | operator | dictionary | input | loop-control | typeerror | memory | matrix-list-comprehension | reading-and-writing-large-files-efficiently | access-modifier | factorial-function | enumerate() | string-concatenation | min-function | namedtuple | control-flow | min-max-function | logical-operation | comment | match | async | data-type | operand | using-the-threading-module | sys-module | using-map()-for-transformations | filtering-and-indexing | while-loop | inheritance | working-with-temporary-files-using-tempfile | dictionary-methods | threading | python-operators | with-statement | iterable | return-statement | creating-custom-modules | assert | matplotlib | regular-expressions | conditional-statements | data-structures | data-structures-in-python | list-comprehension | decimal | multithreading | aggregating-data-with-functools.reduce() | writing:-write(),-writelines() | conversion | raise | identifier | time-series-with-pandas | join | lists | assignment-operators | object-attribute | context-manager | round-function | turtle | while-else-loop | touples | docstring | complex | precedence-and-associativity | reading-and-writing-files | sorting-and-ranking | string-formatting | import-method | arithmetic-expression | functional-programming | __init_subclass__ | conditional-statement | exception-handling | bitwise | assignment-operator | class | global | regex | multiple-inheritance | decorator | type_conversion | pseudocode | boolean-and-non-boolean | list-method | copy | membership-operators-(in,-not-in) | test-discovery | virtual-environment | datatype | descriptors | __future__ | slice | arithmetic-operation | identity-operator | dataframe-and-series-objects | class-decorators | implementation | syntax-error | classes | default-mutable-argument | string-formatting | data-type-conversions | function | heap-memory | using-assertions-(assertequal,-assertraises) | syntax | attribute | input-function | class-and-instance-variable | generators-in-python | swapping | matrix | file-handling | list-join | complex-number | introduction-to-python | __all__-attribute | string-iteration | operator-and | error-handling | oops | method-overloading | multiple-inheritance | id-function | arbitrary-arguments-(*args,-**kwargs) | list | shallow-copy | goto-function | pickling--unpickling | overriding-methods | destructor | pandas | random | floats | raise-statement | conditional-statement | expression | data-structure | fabs-function | intering | file-handling | dicts | lambdas | center | polymorphism | logical-operator | indexing | walking-through-directories-using-os.walk() | asyncio | file_handling | built-in | data-types | library | pass | bitwise-operator | regular-expression | static-method | identity-operator | dictionaries | collections | immutability | magic-method | unit-testing | invalid-list | data-type | type-conversion | using-lists-as-stacks | counter-function | string | data-structure | slicing | sum() | staticmethod | precedence | string-methods | tuple-unpacking | sorting | mysql | global-variable | string-method | single-inheritance | split | command-line-parsing | sum-function | while-loops | filter-function | memory-management | recurssion | key-value-pairs | lambda-function | logical-operator | sorted | map-function | deep-copy | module | tuple | introduction-to-multiprocessing | debugging | benefit | def | generators | control-flow | exception | python-syntax-and-structure | else | math | encoding | design-principle | postfix | list-indexing | creating-and-starting-threads | comprehension | constructor | type-conversion-and-casting | python-repl | global-variable | sets | working-with-binary-files-(rb,-wb) | statement | default-arguments | list-comprehensions | feature | counter | syntax-error | condition | joining-and-merging-dataframes | datetime.date,-datetime.time,-datetime.datetime | data_structure | iterators | pep | error-handling | tuples | string-manipulation | quantifiers-(*,-+,-?,-{}) | update | dictionary-comprehensions | iterator | package-management | range | yield | using-yield-in-functions | virtual-environment | why-use-multiprocessing-over-threading?-(gil) | defining-functions | nested-loop | namespace | operations | datetime | operator-overloading | immutable-data-type | parsing-with-strptime | identity-operators-(is,-is-not) | zfill-function | lambda-functions | indentation | lambda | max-min | escape-operator ...