- 博客(1)
- 收藏
- 关注
原创 【自学python之路】字符串的功能!~
# 放弃多次,拾起多次,各种原因,希望这次能一直走下去,每日分享笔记,记录一下高龄菜鸟求学挣扎之路! 1、判断字符串以xxx开头,使用 .startswith() a = '中国台湾省' b = a.startswith('中国') print(b) # 返回True a = '中国台湾省' b = a.startswith('台湾') print(b) # 返回Flase 2、判断字符串以xxx结尾,使用endswith() a = '中国台湾省' b = a.endswith('中国
2021-09-11 20:12:25 250
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人