Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- word = ""
- secret = "con"
- command = input()
- while command != "End":
- if secret.find(command) != -1:
- secret = secret.replace(command, "")
- if len(secret) == 0:
- print(word, end=" ")
- secret = "con"
- word = ""
- elif command.isalpha():
- word += command
- command = input()
- Или:
- secret = 'con'
- word = ''
- symbol = input()
- while symbol != 'End':
- if symbol in secret:
- secret = secret.replace(symbol, '')
- if secret == '':
- secret = 'con'
- print(word, end=' ')
- word = ''
- elif symbol.isalpha():
- word += symbol
- symbol = input()
- Или:
- secret = 'con'
- string = ''
- word = ''
- symbol = input()
- while symbol != 'End':
- if symbol in secret:
- secret = secret.replace(symbol, '')
- if secret == '':
- secret = 'con'
- string += word + ' '
- word = ''
- elif symbol.isalpha():
- word += symbol
- symbol = input()
- print(string)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement