Slicing strings

amm*_*lam 2 python list slice

In python, I want to slice strings in a list in such a way that first few characters from that list must be removed/spliced out.

a=['hello', 'things', 'becoming', 'expensive']
Run Code Online (Sandbox Code Playgroud)

如何从列表中的每个字符串中删除前两个字符以获取输出

['llo', 'ings', 'coming', 'pensive']

JD2*_*775 6

a=['hello', 'things', 'becoming', 'expensive']
b = []

for word in a:
    b.append(word[2:])


print(b)
Run Code Online (Sandbox Code Playgroud)

结果是:

['llo', 'ings', 'coming', 'pensive']
Run Code Online (Sandbox Code Playgroud)

这段:

word[2:] 
Run Code Online (Sandbox Code Playgroud)

是说从索引 2 开始并将所有内容返回到它的右侧。索引从 0 开始,所以前 2 个字母被忽略