# Use continue to stop execution of the current iteration and start the next iteration of the current loop word = "this is a test" string = "" for ch in word: if ch == 'i': string +='y' continue if ch == ' ': break string += ch print string