I'm at a place in my code where I need to make the order of the contents in one string equal the order of the other. So say you put the string 'this place' into my function you will get TIPAEhslc returned and I want to change the order of the contents of that to match the original input string without the spaces, so: 'ThIsPlAcE'. So, in my code, using no_space to order s_combine I know I've figure this out before but I can't remember how and I've been stuck on this ! This is my code so far:
def r_string(string):
s_even = []
s_odd = []
s_compare = []
s_split = [[x] for x in string.split()]
for i in s_split:
for u in i:
s = enumerate(u)
for j,k in s:
if j % 2 == 0:
s_even.append(k)
else:
s_odd.append(k)
s_even = ''.join(s_even).upper()
s_odd = ''.join(s_odd).lower()
s_combine = s_even + s_odd
no_space = string.replace(" ","")