I have long lines in my code such as:
if (currentExcelDep[excelPackageName]== depDataCollection[depDataCollectionSet][depDataCollectionSetElement][excelPath] and currentExcelDep[excelPath].split("/")[1] == depDataCollection[depDataCollectionSet][depDataCollectionSetElement][0].split("/")[1] and depDataCollection[depDataCollectionSet][depDataCollectionSetElement][excelVersion]and currentExcelDep[3] == "Approved"):
And my problem is that im having an IndexError SOMEWHERE in this line, because this is the output:
Traceback (most recent call last):
File "main_collection.py", line 96, in <module>
if (currentExcelDep[excelPackageName]== depDataCollection[depDataCollectionSet][depDataCollectionSetElement][excelPath] and currentExcelDep[excelPath].split("/")[1] == depDataCollection[depDataCollectionSet][depDataCollectionSetElement][0].split("/")[1] and depDataCollection[depDataCollectionSet][depDataCollectionSetElement][excelVersion]and currentExcelDep[3] == "Approved"):
IndexError: list index out of range
How on earth do I know, where the problem is in the code?
I mean yeah, I can look it up in my spaghetti code and figure out by myself by splitting this big expression to smaller ones, but I want to learn how to deal with this more efficiently, in this case, and also in the future.