2022年 11月 7日

python查看函数参数_python怎么查看函数有什么参数

展开全部

由于2113Python语言的动态类型特性,在5261集成开发环境4102或编辑工具1653编码时,给予的代码提示及自版动完成功能不权象静态语言工具(比如使用VisualStudio开发C#)那样充分。

实现开发过程中,我们借助于相关插件或使用Python内置函数”help()”来查看某个函数的参数说明,以查看内置函数sorted()为例:>>> help(sorted)

Help on built-in function sorted in module builtins:

sorted(iterable, key=None, reverse=False)

Return a new list containing all items from the iterable in ascending order.

A custom key function can be supplied to customise the sort order, and the

reverse flag can be set to request the result in descending order.

>>>