Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char = input()
- word = ''
- n_found = False
- o_found = False
- c_found = False
- line = ''
- while not char == 'End':
- if 65 <= ord(char) <= 90 or 97 <= ord(char) <= 122:
- if char == 'n':
- if n_found:
- word += char
- else:
- n_found = True
- elif char == 'o':
- if o_found:
- word += char
- else:
- o_found = True
- elif char == 'c':
- if c_found:
- word += char
- else:
- c_found = True
- else:
- word += char
- if n_found and c_found and o_found:
- line += f'{word} '
- word = ''
- n_found = False
- o_found = False
- c_found = False
- char = input()
- print(line)
Advertisement
Add Comment
Please, Sign In to add comment