[Python] Why is this saying that the object is not subscriptable (Python) [duplicate]

Discussão em 'Python' iniciado por Stack, Julho 21, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to write a code that will detect if a list is a palindrome. Here is what I have so far-

    ##theSubList = raw_input("Input the list here")
    def isPalindrome( theSubList ) :
    return theSubList == theSubList[::-1]


    Why does this tell me that the "int" object is not subscriptable. The only way I can get this to run is by putting the top line in (the commented out part) but I don't want to have to do that, everything should come from just the isPalindrome( theSubList ).

    Continue reading...

Compartilhe esta Página