【发布时间】:2019-02-14 17:08:47
【问题描述】:
如何从我的代码中打印一个中间值?例如,我的列表中有 fif 值:
list = ['one','two','three','four','fife']
【问题讨论】:
-
使用索引:
list[0]、list[1]等(也不要将您的列表称为list,这是内置函数的名称。) -
lst[int(len(lst)/2)]
-
lst[len(lst)//2]
标签: python python-3.x