Advertisement
bl00dt3ars

01. Activation Keys

Jun 27th, 2021
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.09 KB | None | 0 0
  1. activation_key = input()
  2. command = input()
  3.  
  4. while not command == "Generate":
  5.     command = command.split(">>>")
  6.     if command[0] == "Contains":
  7.         if command[1] in activation_key:
  8.             print(f"{activation_key} contains {command[1]}")
  9.         else:
  10.             print("Substring not found!")
  11.     elif command[0] == "Flip":
  12.         start_index = int(command[2])
  13.         end_index = int(command[3])
  14.         first_part = activation_key[:start_index]
  15.         second_part = activation_key[start_index:end_index]
  16.         third_part = activation_key[end_index:]
  17.         if command[1] == "Upper":
  18.             second_part = second_part.upper()
  19.         else:
  20.             second_part = second_part.lower()
  21.         activation_key = first_part + second_part + third_part
  22.         print(activation_key)
  23.     elif command[0] == "Slice":
  24.         start_index = int(command[1])
  25.         end_index = int(command[2])
  26.         activation_key = activation_key[:start_index] + activation_key[end_index:]
  27.         print(activation_key)
  28.     command = input()
  29.  
  30. print(f"Your activation key is: {activation_key}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement