python 判断字符串是否以数字结尾
生活随笔
收集整理的這篇文章主要介紹了
python 判断字符串是否以数字结尾
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
使用正則表達式 很簡單具體如下
str_content = "hello886"
str_pattern = re.compile(r".*[0-9]$")
if str_pattern.match(str_content):print("是以數(shù)字結(jié)尾,內(nèi)容為:%s" % str_content)
else:print("不是以數(shù)字結(jié)尾,內(nèi)容為:%s" % str_content)
?
總結(jié)
以上是生活随笔為你收集整理的python 判断字符串是否以数字结尾的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 雷米尔是谁画的啊?
- 下一篇: 油画 五四运动是谁画的啊?