search = "-"; f = open('MyText.txt', 'r') text=f.read() text=text.replace(" ","") listofstrings=text.split(".", len(text)) counter=0 searchcount=0 while counter<len(listofstrings): if listofstrings[counter][0]==search: searchcount+=1 print(listofstrings[counter]) counter+=1 if searchcount==0: print("\nНе нашел(\n") else: print("Было найдено: ") print(searchcount) f.close() if listofstrings [counter] [0] == search: in this line, the interpreter error says that this value is out of range, the text is called the lohr
istofstrings=text.split(".", len(text))second parameter? - gil9red