Всем добрый день. Самостоятельно изучаю Python (по книге "Учимся программировать вместе с Python" Чаплыгин А.Н.). Описанный в книге пример:
>>> print math.__doc__
This module is always available. It provides access to the
mathematical functions defined by the C standard.
>>> print math.pi
3.14159265359
>>> decibel = math.log10(17.0)
Почему то у меня не получается по примеру.
Вот что выходит:
Python 3.1.2 (release31-maint, Sep 17 2010, 20:34:23)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import math
>>> dir(math)
['__doc__', '__name__', '__package__', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'ceil', 'copysign', 'cos', 'cosh', 'degrees', 'e', 'exp', 'fabs', 'factorial', 'floor', 'fmod', 'frexp', 'fsum', 'hypot', 'isinf', 'isnan', 'ldexp', 'log', 'log10', 'log1p', 'modf', 'pi', 'pow', 'radians', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc']
>>> print math._doc_
File "<stdin>", line 1
print math._doc_
^
SyntaxError: invalid syntax
>>> print math
File "<stdin>", line 1
print math
^
SyntaxError: invalid syntax
>>> print math.__doc__
File "<stdin>", line 1
print math.__doc__
^
Может кто подскажет? Заранее очень благодарен.