Try except block doubt

https://online.codingblocks.com/app/player/209779/content/201858/1212/lecture

at 6:46 in this video if there are no movies of a certain length then the value of that length should be 0 right?
but by writing

except:

   freq_title[length]=1

we are giving it a value of 1 instead of 0

Hey @devchopra999_11c6416ab7f09bbf,
We are giving value 1 instead of 0 because one title of this specific length we are searching in dictionary exists due to which we came to except block.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.