热线电话:13121318867

登录
2018-11-28 阅读量: 702
用一行代码搜索字符串的前后缀
print("http://www.google.com".startswith(("http://", "https://")))
print("http://www.google.co.uk".endswith((".com", ".co.uk")))

#1-> True
#2-> True
0.0000
2
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子