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