bl00dt3ars

1

Aug 14th, 2021 (edited)
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.84 KB | None | 0 0
  1. text = input()
  2. command = input()
  3.  
  4. while command != "Done":
  5.     command = command.split()
  6.     if command[0] == "Change":
  7.         if command[1] in text:
  8.             text = text.replace(command[1], command[2])
  9.             print(text)
  10.         else:
  11.             print(text)
  12.     elif command[0] == "Includes":
  13.         if command[1] in text:
  14.             print("True")
  15.         else:
  16.             print("False")
  17.     elif command[0] == "End":
  18.         print(text.endswith(command[1]))
  19.     elif command[0] == "Uppercase":
  20.         text = text.upper()
  21.         print(text)
  22.     elif command[0] == "FindIndex":
  23.         print(text.index(command[1]))
  24.     elif command[0] == "Cut":
  25.         start_index = int(command[1])
  26.         count = int(command[2])
  27.         text = text[:start_index] + text[start_index + count:]
  28.         print(text)
  29.  
  30.     command = input()
Add Comment
Please, Sign In to add comment