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 羅明 閱讀(1335) 評論(27)  編輯  收藏 所屬分類: StudyPython
          Comments
           
          主站蜘蛛池模板: 琼中| 顺义区| 水城县| 雷州市| 门源| 南华县| 平顺县| 嫩江县| 隆子县| 收藏| 沙田区| 容城县| 芒康县| 京山县| 怀化市| 姜堰市| 涞源县| 开平市| 北票市| 黎平县| 方正县| 汽车| 柘城县| 库尔勒市| 景泰县| 阳江市| 广宗县| 昌邑市| 桐梓县| 区。| 巨鹿县| 逊克县| 福清市| 眉山市| 民丰县| 弥渡县| 剑川县| 玉林市| 阳谷县| 桓台县| 广丰县|