亚洲精品国产精品乱码视色,下载应用成人电影AVapp,成人影院下载视频

      <track id="gfhue"><i id="gfhue"></i></track><input id="gfhue"></input>

      1. 更多精彩內(nèi)容,歡迎關(guān)注:

        視頻號(hào)
        視頻號(hào)

        抖音
        抖音

        快手
        快手

        微博
        微博

        python string函數(shù)

        文檔

        python string函數(shù)

        python string函數(shù)包括:1、str.capitalize();2、str.upper();3、str.lower();4、str.swapcase();5、str.title();6、str.center()。
        推薦度:
        導(dǎo)讀python string函數(shù)包括:1、str.capitalize();2、str.upper();3、str.lower();4、str.swapcase();5、str.title();6、str.center()。

        python string函數(shù)是什么?一起來(lái)看下吧:

        python string函數(shù)包括:

        1、str.capitalize:將原字符串內(nèi)的首字母轉(zhuǎn)成大寫(xiě),其他部分小寫(xiě),再返回新字符串

        print("s.capitalize()?=?{function}"
        s.capitalize()?=?Abcada?a

        2、str.lower:將原字符串的字母轉(zhuǎn)為小寫(xiě)

        print("s.lower()?=?{function}".format(function?=?s.lower()))
        s.lower()?=?abcada?a

        3、str.upper:將原字符串的字母轉(zhuǎn)為大寫(xiě)

        print("s.upper()?=?{function}".format(function?=?s.upper()))
        s.upper()?=?ABCADA?A

        4、str.swapcase:將原字符串的大寫(xiě)小寫(xiě)反轉(zhuǎn)

        print("s.swapcase()?=?{function}".format(function?=?s.swapcase()))
        s.swapcase()?=?ABCAdA?A

        5、str.title:原字符串內(nèi)如果有特殊字符(包括數(shù)字)連接字母,則將特殊字符后的首個(gè)英文字母轉(zhuǎn)化為大寫(xiě)形態(tài),并返回新字符串

        print("s2.title()?=?{function}".format(function?=?s2.title()))
        s2.title()?=?123A?Abc?Abcsaa?S

        6、str.center:str.center(寬度,填充字符) 將字符串以居中的格式返回,若寬度值比len(s)小則返回原字符串,填充以從左到右為規(guī)則,填充字符的默認(rèn)值為空格,值可以自己更改

        print("s2.center()?=?{function}".format(function?=?s2.center(19,'&')))
        print("s2.center()?=?{function}".format(function?=?s2.center(20,'&')))
        #s2?=?123a?abc?ABCSAa?s
        s2.center()?=?&123a?abc?ABCSAa?s?
        s2.center()?=?&123a?abc?ABCSAa?s?&

        7、str.expandtabs:str.expandtabs(tabsize = 8) 將原字符串中 以前的字符補(bǔ)滿8位(默認(rèn)),tabsize的值從0-7即8位,在0-7中任意取值則默認(rèn)tabsize = 8,此后往上+1,就相當(dāng)于增加一個(gè)空格

        print("s3.expandtabs?={function}".format(function?=?s3.expandtabs()))
        print("s3.expandtabs?={function}".format(function?=?s3.expandtabs(0)))
        print("s3.expandtabs?={function}".format(function?=?s3.expandtabs(5)))
        print("s3.expandtabs?={function}".format(function?=?s3.expandtabs(8)))
        print("s3.expandtabs?={function}".format(function?=?s3.expandtabs(9)))#s3?=?"	as?		b123"
        s3.expandtabs?=????????as??????????????b123
        s3.expandtabs?=as?b123
        s3.expandtabs?=?????as????????b123
        s3.expandtabs?=????????as??????????????b123
        s3.expandtabs?=?????????as

        除了上述舉例的,string函數(shù)還有許多實(shí)用的函數(shù)。

        以上就是小編今天的分享,希望可以幫助到大家。

        文檔

        python string函數(shù)

        python string函數(shù)包括:1、str.capitalize();2、str.upper();3、str.lower();4、str.swapcase();5、str.title();6、str.center()。
        推薦度:
        為你推薦
        資訊專(zhuān)欄
        熱門(mén)視頻
        相關(guān)推薦
        python構(gòu)造函數(shù) python延時(shí)函數(shù) debug error怎么解決 python讀取json并解析 python 列表添加 python字典按值的大小排序 python 排序算法 spring boot mysql配置 vue動(dòng)態(tài)綁定style js date加一天 字符轉(zhuǎn)換成ascii碼 c語(yǔ)言struct用法 java reentrantlock python tkinter教程 js獲取日期 python numpy教程 opencv安裝教程python js獲取隨機(jī)數(shù) ubuntu卸載mysql cad的基本命令 python類(lèi)的繼承 python遞歸函數(shù) python內(nèi)置函數(shù) python判斷字符串相等 python查看已安裝的包 python強(qiáng)制類(lèi)型轉(zhuǎn)換 python input函數(shù)怎么用 python類(lèi)型轉(zhuǎn)換 python split函數(shù)用法 python讀取json python組合數(shù)據(jù)類(lèi)型 python查看變量類(lèi)型 python split函數(shù) c++ template用法 老抽和生抽的區(qū)別 拉鏈下滑如何解決 防藍(lán)光眼鏡怎么辨別 蔥怎么保存 老姜和生姜的區(qū)別 新鮮蘑菇怎么保存
        Top