Nov-06-2019, 10:22 AM
i have a list and i want to remove all non digit element from it,but got some problem.
there is my code , can you help me:
there is my code , can you help me:
match = re.compile(r'ROL N°.[0-9][0-9].') case_title = re.sub(match,'',expression) num_case= match.search(expression) first_case_num=[] first_case_num = num_case.group() second_case_num= num_case.group() for case in first_case_num: if case.isdecimal(): pass else: first_case_num.remove(case)
Quote:---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-91-521c272a0c4b> in <module>
27 print(case)
28 else:
---> 29 first_case_num.remove(case)
30
31
AttributeError: 'str' object has no attribute 'remove'