当前位置:网站首页>String judgment

String judgment

2022-07-05 07:47:00 Fall in love with wx

qingxin = 520  #qingxin For the string 
qingxin.isalnum()   All characters are numbers or letters , Go back to  Ture, Otherwise return to  False.
qingxin.isalpha()    All characters are letters , Go back to  Ture, Otherwise return to  False.
qingxin.isdigit()      All characters are numbers , Go back to  Ture, Otherwise return to  False.
qingxin.islower()     All characters are lowercase , Go back to  Ture, Otherwise return to  False.
qingxin.isupper()    All characters are uppercase , Go back to  Ture, Otherwise return to  False.
qingxin.istitle()   All words are capitalized , Go back to  Ture, Otherwise return to  False.
qingxin.isspace()    All characters are blank , Go back to  Ture, Otherwise return to  False.

such as

>>> wangxi = "I LOVE WANGXI"
>>> wangxi.isupper()
True
>>> 

原网站

版权声明
本文为[Fall in love with wx]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140550343404.html