将文件对应的索引打印出来 test = input(">>>>") print(test) l = len(test) print(l) t = range(l) for item in t: print(item,test[item]) # 方法精简2 test = input(">>>>") for item in range(0,len(test)): print(item,test[item])
原文:https://www.cnblogs.com/xiaomai-rhce/p/10085511.html