亚洲欧洲国产欧美一区精品,激情五月亚洲色五月,最新精品国偷自产在线婷婷,欧美婷婷丁香五月天社区

      python

      當(dāng)前位置:中華考試網(wǎng) >> python >> python編程基礎(chǔ) >> 文章內(nèi)容

      python的函數(shù)

      來(lái)源:中華考試網(wǎng)  [2020年9月16日]  【

        

        Python的函數(shù)支持遞歸、默認(rèn)參數(shù)值、可變參數(shù),但不支持函數(shù)重載。為了增強(qiáng)代碼的可讀性,可以在函數(shù)后書寫“文檔字符串”(Documentation Strings,或者簡(jiǎn)稱docstrings),用于解釋函數(shù)的作用、參數(shù)的類型與意義、返回值類型與取值范圍等。可以使用內(nèi)置函數(shù)help()打印出函數(shù)的使用幫助。比如:

        >>> def randint(a, b):

        ... "Return random integer in range [a, b], including both end points."...

        >>> help(randint)

        Help on function randint in module __main__:

        randint(a, b)

        Return random integer inrange[a, b], including both end points.

      責(zé)編:hym
      • 會(huì)計(jì)考試
      • 建筑工程
      • 職業(yè)資格
      • 醫(yī)藥考試
      • 外語(yǔ)考試
      • 學(xué)歷考試