Variable freq_title(key) is not assigned any value

in this video when did you assign title value to variable freq_title.u did not initiate the dictionary and u did not assign any value to the key

also Bhaiyya from where do we access the movie file. Where is it

Hey @surbhi11, if you look into the code, you can see this :

if freq_titles.get(length) is None : 
     freq_titles[length] = 1

else : 
     freq_titles[length] += 1

The above code is initialising the dictionary. The first if statement checks if a particular key is present in the dictionary or not. If there is no such key = length , we initialise inside the if statement with freq_titles[length]=1. If there is already a key present then if condition becomes false and inside else we simply increment the value corresponding to that key.

So this is where the dictionary is created as well as values are manipulated. Also please find the dataset in the link attached below :

I hope this clears your doubt ! :slightly_smiling_face:
Please mark the doubt as resolved in your doubts section ! :slight_smile:
Happy Learning ! :+1:

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.