📜  如何在python代码示例中打印出偶数索引

📅  最后修改于: 2022-03-11 14:46:44.396000             🧑  作者: Mango

代码示例1
T = list(input().split())
for j in T:
    a = ""
    b = ""
    for i in range(0,len(j)):
        if i%2 == 0:
            a = a+j[i]
        else :
            b = b + j[i]
    print(a+" "+b)