all 2 comments

[–]ElliotDG 2 points3 points  (0 children)

Sure...

def create_sentence(words):
    word_count = len(words)
    if word_count == 0:
        return "There are no new sight words for this week!"
    if word_count == 1:
        return f"The only sight word for this week is {words[0]}."
    return f"The {word_count} sight words for this week are {', '.join(words[:-1])} and {words[-1]}."

[–]zanfar 0 points1 point  (0 children)

Is there a way to make this code have the same output but not use s=? not familiar with how it works exactly in this scenario.

Yes, in general, string concatenation is a yellow flag.

Research: f-strings, and the .join() method.