日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問(wèn)題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
Python字典在linux系統(tǒng)下的相關(guān)介紹

Python字典的用處非常大,在長(zhǎng)時(shí)間的使用中我們就會(huì)發(fā)現(xiàn),他具有廣泛的應(yīng)用范圍,超強(qiáng)的適應(yīng)能力。下面我們就來(lái)看看昨天在網(wǎng)上找了個(gè)能在linux跑的字典程序,分享一下。Python字典其實(shí)是一個(gè)很好使的語(yǔ)言。

網(wǎng)站的建設(shè)成都創(chuàng)新互聯(lián)公司專注網(wǎng)站定制,經(jīng)驗(yàn)豐富,不做模板,主營(yíng)網(wǎng)站定制開發(fā).小程序定制開發(fā),H5頁(yè)面制作!給你煥然一新的設(shè)計(jì)體驗(yàn)!已為地磅秤等企業(yè)提供專業(yè)服務(wù)。

 
 
 
  1. #!/usr/bin/python  
  2. f=open(‘wordlist’, ‘w’)  
  3. def xselections(items, n):  
  4. if n==0: yield []  
  5. else:  
  6. for i in xrange(len(items)):  
  7. for ss in xselections(items, n-1):  
  8. yield [items[i]]+ss  
  9. # Numbers = 48 – 57  
  10. # Capital = 65 – 90  
  11. # Lower = 97 – 122  
  12. numb = range(48,58)  
  13. cap = range(65,91)  
  14. low = range(97,123)  
  15. choice = 0 
  16. while int(choice) not in range(1,8):  
  17. choice = raw_input(”’  
  18. 1) Numbers  
  19. 2) Capital Letters  
  20. 3) Lowercase Letters  
  21. 4) Numbers + Capital Letters  
  22. 5) Numbers + Lowercase Letters  
  23. 6) Numbers + Capital Letters + Lowercase Letters  
  24. 7) Capital Letters + Lowercase Letters  
  25. : ”’)  
  26. choice = int(choice)  
  27. poss = []  
  28. if choice == 1:  
  29. poss += numb  
  30. elif choice == 2:  
  31. poss += cap  
  32. elif choice == 3:  
  33. poss += low  
  34. elif choice == 4:  
  35. poss += numb  
  36. poss += cap  
  37. elif choice == 5:  
  38. poss += numb  
  39. poss += low  
  40. elif choice == 6:  
  41. poss += numb  
  42. poss += cap  
  43. poss += low  
  44. elif choice == 7:  
  45. poss += cap  
  46. poss += low  
  47. bigList = []  
  48. for i in poss:  
  49. bigList.append(str(chr(i)))  
  50. MIN = raw_input(“What is the min size of the 
    word? “)  
  51. MIN = int(MIN)  
  52. MAX = raw_input(“What is the max size of 
    the word? “)  
  53. MAX = int(MAX)  
  54. for i in range(MIN,MAX+1):  
  55. for s in xselections(bigList,i): f.write(”.
    join(s) + ‘\n’) 

以上就是對(duì)Python字典的詳細(xì)介紹。


新聞標(biāo)題:Python字典在linux系統(tǒng)下的相關(guān)介紹
鏈接地址:http://m.5511xx.com/article/dppjccs.html