Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- end_command = "End"
- word = ""
- text = ""
- count_c = 0
- count_o = 0
- count_n = 0
- while True:
- character = str(input())
- if character == end_command:
- print(f"{text}")
- break
- if character != "n" and character != "c" and character != "o" :
- if (ord(character) in range(ord("a"), ord("z"))) or (ord(character) in range(ord("A"), ord("Z"))):
- word += character
- if count_c == 1 and character == "c":
- word += character
- if count_o == 1 and character == "o":
- word += character
- if count_n == 1 and character == "n":
- word += character
- if character == "c":
- count_c = 1
- if character == "o":
- count_o = 1
- if character == "n":
- count_n = 1
- if count_c == 1 and count_n == 1 and count_o == 1:
- text += word + " "
- word = ""
- count_c = 0
- count_n = 0
- count_o = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement