我想的是输入s[0::2]这个代码来解决,发现不行,不知道错在那里
可以啊
a=input() print(a[::2])
s='hello!world' for i in range(len(s)): if i %2==0: print(s[i])