Answer:
The program code is at explaination
Step-by-step explanation:
Below is the Python Function;
def check_halves(s):
# exact half not possible condition
if len(s)%2!=0:
return 0
halflen=len(s)//2
s1=s[:halflen]
s2=s[halflen:]
#null string condition
if len(s1)==0 or len(s2)==0:
return 0
#checking 1st digit of string recursively
if s1[0]==s2[0]:
return 1+check_halves(s1[1:]+s2[1:])
else:
return 0
You will find the input and output ad attachment.