0

I want to search through a text file and output substrings that match the user input, but when my program searches each line I want it to only search the characters between the "|" character and the end of the line. But I keep getting the following error:

2

1 Answer 1

1

You should use slices. Just replace , with : in your code:

y = line[char_pos:x]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.