search
尋找貓咪~QQ 地點 桃園市桃園區 Taoyuan , Taoyuan

python 陳述句寫法 - Python 教學筆記本


# 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




熱門推薦

本文由 python-learnnotebookblogspotcom 提供 原文連結

寵物協尋 相信 終究能找到回家的路
寫了7763篇文章,獲得2次喜歡
留言回覆
回覆
精彩推薦