def front_back if len a_start len a_end len else a_start len a_end len

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
def front_back(a, b):
if (len(a) % 2) > (0):
a_start = a[:(len(a)+1)//2]
a_end = a[(len(a)+1)//2:]
else:
a_start = a[:(len(a))//2]
a_end = a[len(a)//2:]
a = a_start
if (len(b) % 2) > (0):
b_start = b[:(len(b)+1)//2]
b_end = b[(len(b)+1)//2:]
else:
b_start = b[:(len(b))//2]
b_end = b[len(b)//2:]
b = b_start
a = a_start + b_start + a_end + b_end
return a