Advertisement
dimanou_04

01_activation_keys

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