AttributeError: `NoneType` object has no attribute ‘something’

My friend has shared a code with me. When I run it, I’m getting the AttributeError: 'NoneType' object has no attribute 'something' error. I got this error for the very first time and didn’t know how to resolve it. The code that shows me an error is below:

Can someone explain what this error is trying to say and how can I resolve it?