有什么技巧将这句话切成我想要的格式?

时间:2018-11-27 02:23:17

标签: python slice

如何切片

'Python is an interesting and useful language for numerical computing!' 

获取

'Pto sa neetn n sfllnug o ueia optn!? 

在Python中?

1 个答案:

答案 0 :(得分:0)

列出索引魔术(而不是魔术)

data = 'Python is an interesting and useful language for numerical computing!'
print(data)
print(data[0::2])