I'm trying to get a substring in a for loop. For that I'm using this:
for peoject in subjects:
peoject_name = peoject.content
print(peoject_name, " : ", len(peoject_name), " : ", len(peoject_name.split('-')[1]))
I have some projects that don't have any "-" in the sentence. How can I deal with this?
I'm getting this issue:
builtins.IndexError: list index out of range