用endwith()方法可以判断字符串是否以某个或者某几个字母或者数字结尾
1 a = 'auy.geojson' 2 b = 'auy' 3 print(a.endswith('.geojson')) 4 print(b.endswith('.geojson'))
结果
1 True 2 False 3 4 Process finished with exit code 0
用endwith()方法可以判断字符串是否以某个或者某几个字母或者数字结尾
1 a = 'auy.geojson' 2 b = 'auy' 3 print(a.endswith('.geojson')) 4 print(b.endswith('.geojson'))
结果
1 True 2 False 3 4 Process finished with exit code 0