Is there a way to split a string into 2 equal halves without using a loop in Python?
In Python 3: If you want something like madam => ma d am maam => ma am
first_half = s[0:len(s)//2] second_half = s[len(s)//2 if len(s)%2 == 0 else ((len(s)//2)+1):]