1. <source id="nejs2"></source>
  2. <video id="nejs2"></video>
    <source id="nejs2"></source>
          1. Python istitle()

            更新:

            python 中的istitle()函數有助于檢查字符串是否有標題。如果是,則返回真,否則返回假。這里的單詞 titlecased 表示每個單詞的第一個字符是大寫字母,單詞中的其余字符是小寫字母。

             **string.istitle()** 
            

            istitle()參數:

            istitle()方法不接受任何參數。在檢查字符串時,所有符號和數字都被忽略。

            istitle()返回值

            返回值始終是布爾值。如果是空字符串、數字字符串或只有符號的字符串,函數將返回 False。

            | 投入 | 返回值 | | 標題大小寫字符串 | 真實的 | | 不是標題大小寫字符串 | 錯誤的 |

            Python 中istitle()方法的示例

            示例 1:istitel()在 Python 中是如何工作的?

             string = 'Hi How Are You'
            print(string.istitle())
            
            string = 'Hi how are you'
            print(string.istitle())
            
            string = 'Hi How Are You?'
            print(string.istitle())
            
            string = '121 Hi How Are You'
            print(string.istitle())
            
            string = 'HOW ARE YOU'
            print(string.istitle()) 
            

            輸出:

             True
            False
            True
            True
            False 

            示例 2:如何在 Python 中使用istitle()?

             string = 'Python programming'
            if string.istitle() == True:
              print('It is a Titlecased String')
            else:
              print('It is not a Titlecased String')
            
            string = 'PYthon PRogramming'
            if string.istitle() == True:
              print('It is a Titlecased String')
            else:
              print('It is not a Titlecased String') 
            

            輸出:

             It is a Titlecased String
            It is not a Titlecased String 
            頂部 久久久久99精品成人片毛片_黃色A片三級三級三級无码_日本不卡高清视频v中文字幕_高清欧美视频一区二区
            1. <source id="nejs2"></source>
            2. <video id="nejs2"></video>
              <source id="nejs2"></source>