Nonetype Object Is Not Subscriptable Python