Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- text = input()
- command = input()
- while command != "Done":
- command = command.split()
- if command[0] == "Change":
- if command[1] in text:
- text = text.replace(command[1], command[2])
- print(text)
- else:
- print(text)
- elif command[0] == "Includes":
- if command[1] in text:
- print("True")
- else:
- print("False")
- elif command[0] == "End":
- print(text.endswith(command[1]))
- elif command[0] == "Uppercase":
- text = text.upper()
- print(text)
- elif command[0] == "FindIndex":
- print(text.index(command[1]))
- elif command[0] == "Cut":
- start_index = int(command[1])
- count = int(command[2])
- text = text[:start_index] + text[start_index + count:]
- print(text)
- command = input()
Add Comment
Please, Sign In to add comment