For this Question: Given a string(1-indexed). Print all the characters of the string at odd positions.The first line of the input contains a string S. String contains only lowercase english letters.

Constraints:-
1 <= |S| <= 100
The output should contain the character's at odd positions seperated by space.Sample Input
abcde

Sample Output
a c e

Sample Input
abcd

Sample Output
a c

Explanation:
index => 1 2 3 4
chars => a b c d
a and c are at odd index., I have written this Solution Code: str1 = input()

str2 = ''

for i in range(len(str1)):
    if(i % 2 == 0):
        str2 = str2 + str1[i]+" "
        
print(str2), In this Programming Language: Python, Now tell me if this Code is compilable or not?