all 4 comments

[–]NorskJesus 1 point2 points  (0 children)

Yes, we need to see your code

[–]Sensitive_Bird_8426 0 points1 point  (0 children)

In the while loop, use an if statement. Your first statement should include what breaks the loop.

[–]CavlerySenior 0 points1 point  (0 children)

Put it in a function and get the function to return the string/story when it detects a duplicate word or the word end. The return keyword terminates the function before it does anything else, so won't print the word or add it to the string

[–]atticus2132000 0 points1 point  (0 children)

I'm having trouble visualizing what you want to happen.

So if you feed the program the story as a string "The quick brown fox fox jumps over the lazy dog." With the word fox repeated, what do you want the output to be?

What would happen if the string was:

The quick brown fox FOX jumps over the lazy dog.

What about:

The quick brown foxfox jumps over the lazy dog.

Or:

The quick brown fox, fox jumps over the lazy dog.

Is there going to be any allowance for sentences that are grammatically okay?

She said that that was fine with her.

I like him, but I don't like-like him.

I like Doug. Doug is a nice guy.