I am having a problem accessing multiple lists with two criteria: Case_Num
and Case_Type
. I do not know how to fix the error of concatenate string and lists objects.
I have tried using loops and combing strings and regular integer values.Unfortunatley I keep getting same error. Any help would be appreicated
_2019_case_1=[]
_2019_case_2=[]
_2019_case_3=[]
Case_Num=[2019,2019,2019,2020,2020,2020,2024,2024,2024,2029,2029,2029]
Case_Type=[1,2,3,1,2,3,1,2,3,1,2,3]
dr = "F:\C\FE\CD\Tran\ctg"
read_files =[]
for root, _, files in os.walk(dr):
read_files_2="_"+Case_Num+"_case_"+Case_Type
for file in files:
if file in read_files_2:
read_files.append(os.path.join(root, file))
Error I receive
read_files_2="_"+Case_Num+"_case_"+Case_Type
TypeError: cannot concatenate 'str' and 'list' objects