Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string = input()
- while True:
- command = input()
- if command == 'End':
- break
- args = command.split(' ')
- action = args[0]
- if action == 'Translate':
- char = args[1]
- replacement = args[2]
- string = string.replace(char, replacement)
- print(string)
- elif action == 'Includes':
- substring = args[1]
- print(substring in string)
- elif action == 'Start':
- substring = args[1]
- print(string.startswith(substring))
- elif action == 'Lowercase':
- string = string[::].lower()
- print(string)
- elif action == 'FindIndex':
- char = args[1]
- print(string.rindex(char))
- elif action == 'Remove':
- start_index = int(args[1])
- count = int(args[2])
- string = string[start_index + count:]
- print(string)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement