I know it can be simply done through string slicing but i want to know where is my logic or code is going wrong. Please Help!
S=input()
string=""
string2=""
list1=[]
list1[:0]=S
for i in list1:
if(i%2==0):
string=string+list1[i]
else:
string2=string2+list1[i]
print(string," ",string2)
Here's my code. Firstly i stored each character of string in the list and went by accessing the odd even index of the list. But i'm getting this error
if(i%2==0):
TypeError: not all arguments converted during string formatting