[Python] PyCharm, range, Expected type '_SupportsIndex', got 'int' instead

Discussão em 'Python' iniciado por Stack, Maio 6, 2025.

  1. Stack

    Stack Membro Participativo

    How to clear these annoying yellow things?


    Expected type '_SupportsIndex', got 'int' instead
    ​

    They were not there when I didn't have a GitHub Desktop app OR when I didn't have PyCharm updated.

    str0 = input()
    str1 = input()
    k = str1.count(str0)
    i = 0
    for i in range(k, 0, -1):
    if (str0 * i) in str1:
    break
    print(i)


    This is what PyCharm shows me:

    [​IMG]

    Continue reading...

Compartilhe esta Página