简体   繁体   中英

PyCharm, range, Expected type '_SupportsIndex', got 'int' instead

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:

这就是 PyCharm 向我展示的

File -> Manage IDE Settings -> Restore Default Settings

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM