摘要:
re.findall(pattern,string)会搜索所有匹配的字符,返回的是一个列表,获取首个匹配需要re.findall(pattern,string)[0]访问, 但是如果findall没匹配成功则返回空列表,这时用列表下标去访问元素时就会报IndexError: list index o 阅读全文
摘要:
官方文档: sort(*, key=None, reverse=False) This method sorts the list in place, using only < comparisons between items. Exceptions are not suppressed - if 阅读全文