Split a string into 2 in Python
Whoever is suggesting string[:len(string)/2], string[len(string)/2]
is not keeping odd length strings in mind!
This works perfectly. Verified on edx.
first_half = s[:len(s)//2]
second_half = s[len(s)//2:]
firstpart, secondpart = string[:len(string)/2], string[len(string)/2:]
a,b = given_str[:len(given_str)/2], given_str[len(given_str)/2:]