如何访问索引本身以获取如下列表?
ints = [8, 23, 45, 12, 78] for i in ints: print('item #{} = {}'.format(???, i))
当我使用循环遍历它时for,如何访问循环索引,在这种情况下从1到5?
for
python loops list
我正在使用for循环来读取文件,但我只想读取特定的行,比如第26行和第30行.是否有任何内置功能来实现这一目标?
谢谢
python file line
python ×2
file ×1
line ×1
list ×1
loops ×1