Zi 字媒體
2017-07-25T20:27:27+00:00
# python3.5 以後支持這種陳述句寫法
# 可以在 args 內做 remark,告訴其他人該傳何種型態的參數
def test(a: int, b: str , c: str = 5) -> "you remark":
return a, b, c
def test_1(a: int, b: str , c: str = 5) -> list:
return a, b, c
def test_2(a: int, b: str , c: str = 5) -> dict:
return a, b, c
def test_3(a: int, b: str , c: str = 5) -> tuple:
return a, b, c
寫了
5860316篇文章,獲得
23313次喜歡