Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- activation_key = input()
- while True:
- command = input().split(">>>")
- if command[0] == "Generate":
- break
- elif command[0] == "Contains":
- substring = command[1]
- if substring in activation_key:
- print(f"{activation_key} contains {substring}")
- else:
- print("Substring not found!")
- elif command[0] == "Flip":
- flip_type = command[1]
- start_idx, end_idx = int(command[2]), int(command[3])
- if flip_type == "Upper":
- changed_part = activation_key[start_idx:end_idx].upper()
- activation_key = activation_key[:start_idx] + changed_part + activation_key[end_idx:]
- elif flip_type == "Lower":
- changed_part = activation_key[start_idx:end_idx].lower()
- activation_key = activation_key[:start_idx] + changed_part + activation_key[end_idx:]
- print(activation_key)
- elif command[0] == "Slice":
- start_idx, end_idx = int(command[1]), int(command[2])
- activation_key = activation_key[:start_idx] + activation_key[end_idx:]
- print(activation_key)
- print(f"Your activation key is: {activation_key}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement