Method Is Not Subscriptable Python