Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- text = input()
- while True:
- command = input()
- if command == 'End':
- break
- args = command.split()
- cmd = args[0]
- if cmd == 'Translate':
- old = args[1]
- new = args[2]
- text = text.replace(old, new)
- print(text)
- elif cmd == 'Includes':
- sub_text = args[1]
- if sub_text in text:
- print('True')
- else:
- print('False')
- elif cmd == 'Start':
- sub_text = args[1]
- if sub_text == text[:len(sub_text)]:
- print('True')
- else:
- print('False')
- elif cmd == 'Lowercase':
- text = text.lower()
- print(text)
- elif cmd == 'FindIndex':
- letter = args[1]
- print(text.rindex(letter))
- elif cmd == 'Remove':
- start = int(args[1])
- end = int(args[2]) + start
- sub_text = text[start: end]
- text = text.replace(sub_text, '')
- print(text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement