Sublime Forum

Attribute error>>>Python 3.7

#1

The program is:’’’ Write a Python program to print the documents (syntax, description etc.) of Python built-in function(s).’’’

In python tutor:
print(abs.doc) out puts >>Return the absolute value of the argument.

But both in IDLE, and sublime text throws up error:
print(abs.doc)
AttributeError: ‘builtin_function_or_method’ object has no attribute ‘doc

Any help will be appreciated

0 Likes

#2

Did you try print(abs.__doc__) as well?

0 Likes

#3

The fool I am, I input only single “underscore”.>>print(abs.doc).
Many thanks: print(abs.doc) works fine.

0 Likes