星空博客

2020年12月30日

python timedelta()

摘要: datetime.timedelta(days=0,seconds=0,microseconds=0,milliseconds=0,minutes=0,hours=0,weeks=0) 阅读全文

posted @ 2020-12-30 16:39 星空博客 阅读(77) 评论(0) 推荐(0) 编辑

Python str.splitlines()方法

摘要: 用途:Python splitlines() 按照行('\r', '\r\n', \n')分隔,返回一个包含各行作为元素的列表,如果参数 keepends 为 False,不包含换行符,如果为 True,则保留换行符。 拆分一个包含多行的字符串,以每行为一个元素返回一个列表。如果字符串不是多行的,则 阅读全文

posted @ 2020-12-30 14:00 星空博客 阅读(293) 评论(0) 推荐(0) 编辑

python str.startswith()

摘要: 用途:与str.endwith()相反,判断字符串是否以指定前缀开始。 语法:str.startwith(prefix[, start[, end]]): 示例1: s = 'Apollo' s.startswith('Ap') print(s.startswith('Ap')) 打印结果:True 阅读全文

posted @ 2020-12-30 13:55 星空博客 阅读(217) 评论(0) 推荐(0) 编辑

导航