Run
# Input string x = "HelloWorld" # Calculate the midpoint index midpoint = len(x) // 2 # Split the string into two halves first_half = x[:midpoint] second_half = x[midpoint:] # Print the results print(f"First half : {first_half}") print(f"Second half : {second_half}")
Output