There are many ways by which you can split string’s every nth character some of the import methods are as follows:-
The first method you can use to solve this problem is by using the len() function.
n = 2
[abc[i:i+n] for i in range(0, len(abc), n)]
The second way of solving this problem is by using the regular expression module and its findall() function below is the code that shows how we can use the regular expressions to split string by nth char:-