• <del id="a8uas"></del>
    • 千鋒教育-做有情懷、有良心、有品質(zhì)的職業(yè)教育機(jī)構(gòu)

      400-811-9990
      手機(jī)站
      千鋒教育

      千鋒學(xué)習(xí)站 | 隨時(shí)隨地免費(fèi)學(xué)

      千鋒教育

      掃一掃進(jìn)入千鋒手機(jī)站

      領(lǐng)取全套視頻
      千鋒教育

      關(guān)注千鋒學(xué)習(xí)站小程序
      隨時(shí)隨地免費(fèi)學(xué)習(xí)課程

      上海
      • 北京
      • 鄭州
      • 武漢
      • 成都
      • 西安
      • 沈陽(yáng)
      • 廣州
      • 南京
      • 深圳
      • 大連
      • 青島
      • 杭州
      • 重慶
      當(dāng)前位置:合肥千鋒IT培訓(xùn)  >  技術(shù)干貨  >  python關(guān)鍵字有哪些?

      python關(guān)鍵字有哪些?

      來(lái)源:千鋒教育
      發(fā)布人:xqq
      時(shí)間: 2023-11-11 03:36:31

      python關(guān)鍵字有哪些?

      本文教程操作環(huán)境:windows7系統(tǒng)、Python3.9.1,DELLG3電腦。

      1、keyword模塊進(jìn)行輸出查看

      Helponmodulekeyword:

      NAME

      keyword-Keywords(from"graminit.c")

      FILE

      /usr/lib64/python2.6/keyword.py

      DESCRIPTION

      Thisfileisautomaticallygenerated;pleasedon'tmuckitup!

      Toupdatethesymbolsinthisfile,'cd'tothetopdirectoryof

      thepythonsourcetreeafterbuildingtheinterpreterandrun:

      pythonLib/keyword.py

      FUNCTIONS

      iskeyword=__contains__(...)

      x.__contains__(y)yinx.

      DATA

      __all__=['iskeyword','kwlist']

      kwlist=['and','as','assert','break','class','continue','def',...

      2、得到python關(guān)鍵字列表

      >>>keyword.kwlist

      ['and','as','assert','break','class','continue','def','del','elif','else','except','exec',

      'finally','for','from','global','if','import','in','is','lambda','not','or','pass','print',

      'raise','return','try','while','with','yield']

      3、判斷字符串是否含關(guān)鍵字

      >>>keyword.iskeyword('and')

      True

      >>>

      >>>keyword.iskeyword('has')

      False

      好啦,以上就是關(guān)于關(guān)鍵字查看的全部?jī)?nèi)容了,感興趣的小伙伴可以進(jìn)行設(shè)置查看哦~更多Python學(xué)習(xí)教程請(qǐng)關(guān)注IT培訓(xùn)機(jī)構(gòu):千鋒教育。

      聲明:本站稿件版權(quán)均屬千鋒教育所有,未經(jīng)許可不得擅自轉(zhuǎn)載。

      猜你喜歡LIKE

      python漢諾塔遞歸函數(shù)是什么?

      2023-11-11

      python中定時(shí)器的實(shí)現(xiàn)方式

      2023-11-11

      python中寫(xiě)入文件的出錯(cuò)解決

      2023-11-11

      最新文章NEW

      python關(guān)鍵字有哪些?

      2023-11-11

      python模塊的name屬性

      2023-11-10

      python調(diào)試器是什么

      2023-11-10

      相關(guān)推薦HOT

      更多>>

      快速通道 更多>>

      最新開(kāi)班信息 更多>>

      網(wǎng)友熱搜 更多>>