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

          謎題詳細(xì)描述: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




          版權(quán)所有 羅明
          posted on 2008-05-09 14:32 羅明 閱讀(1335) 評論(27)  編輯  收藏 所屬分類: StudyPython
          Comments
           
          主站蜘蛛池模板: 阿荣旗| 万州区| 大兴区| 田东县| 内丘县| 当阳市| 西林县| 洱源县| 象州县| 信丰县| 元氏县| 岗巴县| 岳阳市| 乌兰浩特市| 芒康县| 沅江市| 孝义市| 自贡市| 铁岭市| 西宁市| 德化县| 丘北县| 镇沅| 建德市| 谷城县| 巴中市| 彰化市| 海兴县| 靖安县| 肥西县| 新沂市| 上饶县| 安吉县| 丹东市| 湖州市| 玛沁县| 大竹县| 牡丹江市| 松阳县| 久治县| 沁阳市|