Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command = input()
- valid_letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
- is_c = False
- is_o = False
- is_n = False
- secret = ""
- secret_word = ""
- while command != "End":
- current_symbol = command
- if current_symbol not in valid_letters:
- command = input()
- continue
- if current_symbol == "c":
- if not is_c:
- is_c = True
- else:
- secret += current_symbol
- elif current_symbol == "o":
- if not is_o:
- is_o = True
- else:
- secret += current_symbol
- elif current_symbol == "n":
- if not is_n:
- is_n = True
- else:
- secret += current_symbol
- if current_symbol not in ["c", "o", "n"]:
- secret += current_symbol
- secret_word = secret
- if is_c and is_o and is_n:
- print(secret_word, end=" ")
- secret = ""
- is_c = False
- is_o = False
- is_n = False
- command = input()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement