當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Python help方法用法及代碼示例

Python 的 help(~) 內置函數允許我們查看模塊、函數、類等的文檔。

參數

1.object | object | optional

要查看其文檔的對象。默認調用內置幫助係統。

返回值

None

例子

要查看 round 內置函數的文檔:

help(round)



Help on built-in function round in module builtins:

round(number, ndigits=None)
    Round a number to a given precision in decimal digits.
 
    The return value is an integer if ndigits is omitted or None.  Otherwise
    the return value has the same type as the number.  ndigits may be negative.

相關用法


注:本文由純淨天空篩選整理自Arthur Yanagisawa大神的英文原創作品 Python | help method。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。