楼主: 胖胖小龟宝
3337 22

[问答] python索引值求解 [推广有奖]

11
hnsxcx 发表于 2020-2-3 14:36:10

回帖奖励 +5

12
zlghs 发表于 2020-2-4 22:19:48

回帖奖励 +5

13
zzhylty 发表于 2020-2-12 15:08:08

回帖奖励 +5

14
gewenhong66 发表于 2020-2-12 23:21:32

回帖奖励 +5


thank a lot

15
三重虫 发表于 2020-3-1 18:57:53

回帖奖励 +5

感谢分享!

16
oniking 发表于 2020-4-4 20:25:17

回帖奖励 +5

yunnandlg 发表于 2019-4-4 15:27
The only way to achieve the impossible is to believe it is possible.
战胜不可能的唯一办法就是要相信 ...
Python的索引  我还是不习惯啊   

17
rrrr336 发表于 2020-4-5 21:50:05

回帖奖励 +5

看了你的程序,有点小小的建议,不知对否:

1. 编号应该是没有重复性的,所以将输入(以空格隔离的)分开,建成字典:
      dt = {}
      s = string.split(' ')
      dt[s[0]] = s[1]

2. 建成字典后,查找、打印将非常方便和高效

      word = '001'
      if word in dt:
           print(word, dt[word])


18
changri5555 发表于 2020-5-31 11:18:10

回帖奖励 +5

19
men007 发表于 2020-6-10 17:21:56

回帖奖励 +5

20
timyang1988 发表于 2020-6-12 10:58:46

回帖奖励 +5

感谢知识分享

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-28 17:56