I run a query and want to make a list from this query. I only need those select items, which I got, but I can't get rid of ","
in lst
.
I tried replace
but it didn't work.
query = """
select
supplier_no_and_name,
accepted,
rejected,
pending,
tdc
from edl_current.supplier_warranty_cost_recovery_warranty_alteryx
where claim_date > "2021-01-01"
"""
lst = query.split()
lst = lst[1-len(lst):len(lst)-13]
for i in range(len(lst)):
lst[i].replace(',',"")
print(lst)
The output is following:
['supplier_no_and_name,', 'accepted,', 'rejected,', 'pending,', 'tdc']