I have done exactly as shown in the video but it is showing error

It is showing error using the if else block as well

Hey @Ak07,
Firstly are you able to print the length of the titles earlier?? Share your complete code file by giving Github or Google Drive link then it will be easy to resolve your doubt.

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.