python初学者请问大神们stock_code_list.append(f.split('.csv

niunai咖啡 |浏览1407次
2017/08/02 17:58
python初学者请问大神们stock_code_list.append(f.split('.csv')[0])这句后边那个[0]是什么意思,为什么要加?
  • 问题补充 : 2017/08/02 19:08

    前面是一个for循环,for f in files:

    files的内容是:

    print(files)

    ['sh600000.csv', 'sh600001.csv', 'sh600002.csv', 'sh600003.csv', 'sh600004.csv', 'sh600005.csv', 'sh600006.csv', 'sh600007.csv', 'sh600008.csv', 'sh600009.csv', 'sh600010.csv', 'sh600011.csv', 'sh600012.csv', 'sh600015.csv', 'sh600016.csv', 'sh600017.csv', 'sh600018.csv', 'sh600019.csv', 'sh600020.csv', 'sh600021.csv', 'sh600022.csv', 'sh600023.csv', 'sh600026.csv', 'sh600027.csv', 'sh600028.csv', 'sh600029.csv', 'sh600030.csv', 'sh600031.csv', 'sh600033.csv', 'sh600035.csv']


收藏关注

满意回答

2017/08/05 21:54

登录 后查看

hws000

其他回答(0)    我来补答
0人关注该问题
+1
 加载中...