TypeError 'NoneType' even after a typecheck python 3.8

visit shbcf.ru