Follow the URL chain to get the result (the chain may contain over 300 URLs......)

          謎題詳細描述:http://www.pythonchallenge.com/pc/def/linkedlist.php

          Python解決方案:
          import urllib

          nothing 
          = "12345"
          ii 
          = 1
          while ii<401:
            source 
          = urllib.urlopen("http://www.pythonchallenge.com" 
              
          + "/pc/def/linkedlist.php?nothing="+nothing).read()
            nothing
          =filter(str.isdigit, source)

            
          print nothing
            
          if source != "and the next nothing is " + nothing:
              
          print "source is not: and the next nothing is " + nothing
              
          print "source is: " + source
              nothing 
          = raw_input("select which number?")
              
          print "you set " + nothing + " as nothing"
            ii
          +=1




          版權所有 羅明
          posted on 2008-05-09 14:32 羅明 閱讀(1342) 評論(27)  編輯  收藏 所屬分類: StudyPython
          Comments
           
          主站蜘蛛池模板: 抚远县| 辉南县| 顺昌县| 绍兴县| 德阳市| 三亚市| 邛崃市| 新泰市| 武威市| 嵊州市| 恩平市| 贡觉县| 鄂托克旗| 济宁市| 门头沟区| 广灵县| 黄梅县| 东兴市| 琼结县| 遂宁市| 错那县| 县级市| 武夷山市| 平乐县| 木兰县| 通化县| 扎鲁特旗| 米脂县| 宁陕县| 应城市| 无锡市| 曲麻莱县| 民勤县| 古交市| 卓尼县| 张家港市| 遂昌县| 肥城市| 华池县| 东丰县| 衡南县|