标签:index rate dex logs enum put print u盘 ret
1 li = ["电脑","鼠标垫","u盘","游艇"] 2 3 # for key,item in enumerate(li,1): 4 # print(key,item) 5 6 # inp = input("请输入商品:") 7 8 # inp_num = int(inp) 9 10 # print(li[inp_num-1]) 11 12 # # 输入汉字查索引 13 # inp = input("请输入商品:") 14 # ret = li.index(inp) 15 # print(ret) 16 17 print(range(1,10)) 18 for i in range(1,10): 19 print(i) 20 print("------------------") 21 for i in range(1,10,2): 22 print(i) 23 print("------------------") 24 for i in range(10,1,-1): 25 print(i) 26 print("------------------") 27 for i in range(10,1,-2): 28 print(i) 29 print("------------------") 30 for i in range(0,-10,-1): 31 print(i) 32 33 li = ["alex","eire"] 34 35 leee = len(li) 36 37 for i in range(0,leee): 38 print(i,li[i])
标签:index rate dex logs enum put print u盘 ret
原文地址:http://www.cnblogs.com/xinyang-pan/p/7253158.html