0
i don't understand why there's no output
text = input() word = input() def search(x, y): new_list=x.split(" ") for i in new_list: if i == y: print("Word found") break elif i != y: continue print("Word not found") search(text, word) i don't understand why instead of "Word not found" no output comes out. As i understood all code after continue has to run but it just doesn't happen.
1 Answer
+ 3
all code in the loop after continue will be skipped for current iteration. So it never executes print("Word not found")