Pythonnonetype Object Is Not Subscriptable Python