Skip to main content
 首页 » 编程设计

python之rtype在Python中是什么意思

2024年12月31日9pander-it

当我做一些代码测试时,在解决方案函数下面有一些评论是这样的:

""" 
:type x: int 
:rtype: int 
""" 

x 是我唯一的输入,那么 rtype 代表什么?

请您参考如下方法:

为避免混淆:

type:    Type of a parameter. 
vartype: Type of a variable.  
rtype:   Return type.