Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command = input()
- c_counter = 0
- o_counter = 0
- n_counter = 0
- c_is_found = False
- o_is_found = False
- n_is_found = False
- word = ""
- while command != 'End':
- current_symbol = command
- symbol = ord(current_symbol)
- if 65 <= symbol <= 90 or 97 <= symbol <= 122:
- if current_symbol == 'c':
- if c_counter >= 1:
- word += current_symbol
- else:
- c_counter += 1
- c_is_found = True
- elif command == 'o':
- if o_counter >= 1:
- word += current_symbol
- else:
- o_counter += 1
- o_is_found = True
- elif command == 'n':
- if n_counter >= 1:
- word += current_symbol
- else:
- n_counter += 1
- n_is_found = True
- else:
- word += current_symbol
- if c_is_found and o_is_found and n_is_found:
- print(f'{word}', end =' ')
- c_counter = 0
- o_counter = 0
- n_counter = 0
- c_is_found = False
- o_is_found = False
- n_is_found = False
- word = ''
- command = input()
Advertisement
Add Comment
Please, Sign In to add comment