我想了解这个函数的声明: ->List[int]:
我已经学习了python的基础知识,以前从未见过这样的函数声明
class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
这是 3.5 版中的新功能。您可以查看文档。
https://docs.python.org/3.5/library/typing.html
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句