av激情亚洲男人的天堂国语,日韩欧美精品一中文字幕,无码av一区二区三区无码,国产又色又爽又刺激的a片,国产又色又爽又刺激的a片

創(chuàng)新互聯(lián)Python教程:Pythonisspace()

python 中的isspace()函數(shù)有助于檢查字符串中的所有字符是否都是空白字符。如果字符串中充滿空白字符(制表符、空格、換行符等),則該函數(shù)返回 true。)否則返回 false。

 **string.isspace()** 

isspace()參數(shù):

isspace()方法不接受任何參數(shù)。

isspace()返回值

返回值始終是布爾值。如果字符串為空,函數(shù)返回假。

| 投入 | 返回值 | | 所有空白字符 | 真實(shí)的 | | 至少一個(gè)非空白字符 | 錯(cuò)誤的 |

Python 中isspace()方法的示例

示例isspace()在 Python 中是如何工作的?

 string = '   \t'
print(string.isspace())

string = ' a '
print(string.isspace())

string = ''
print(string.isspace()) 

輸出:

 True
False
False 

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

 string = '\t  \n'
if string.isspace() == True:
  print('String full of whitespace characters')
else:
  print('String contains non-whitespace characters')

string = '15+3 = 18'

if string.isspace() == True:
  print('String full of whitespace characters')
else:
  print('String contains non-whitespace characters.') 

輸出:

 String full of whitespace characters
String contains non-whitespace characters 

文章標(biāo)題:創(chuàng)新互聯(lián)Python教程:Pythonisspace()
本文來(lái)源:http://uogjgqi.cn/article/ccicece.html
掃二維碼與項(xiàng)目經(jīng)理溝通

我們?cè)谖⑿派?4小時(shí)期待你的聲音

解答本文疑問(wèn)/技術(shù)咨詢(xún)/運(yùn)營(yíng)咨詢(xún)/技術(shù)建議/互聯(lián)網(wǎng)交流