Run
# Take a string x = "Hello World" # Given N N = 4 # Slice to remove last N characters x_sliced = x[:-N] print(f"Resulting string : \"{x_sliced}\"")
Output