Код:
count = 0
oldcount = 0
for char in inwords:
if char == " ":
anagramlist.append(inwords[oldcount, count])
oldcount = count
count = 0
else:
count += 1
ошибка:
Traceback (most recent call last):
File "C:/Users/Knowhaw/Desktop/Python Programs/Anagram solver/HTS anagram.py", line 14,
in <module>
anagramlist.append(inwords[oldcount, count])
TypeError: string indices must be integers
что, черт возьми, происходит?count и oldcount, очевидно, являются целыми числами, но ошибка говорит о том, что они не
Я даже могу написать
anagramlist.append(inwords[int(oldcount), int(count)])
и получить ту же ошибку