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 羅明 閱讀(1342) 評(píng)論(27)  編輯  收藏 所屬分類: StudyPython
          Comments
           
          主站蜘蛛池模板: 云林县| 鄂尔多斯市| 通河县| 石河子市| 浦东新区| 武定县| 漠河县| 留坝县| 大城县| 汾西县| 和林格尔县| 福建省| 馆陶县| 白沙| 吴旗县| 洪江市| 西乡县| 文山县| 河源市| 沾化县| 大安市| 都安| 渑池县| 泊头市| 广元市| 通榆县| 沙坪坝区| 高淳县| 富顺县| 峨山| 合肥市| 兴安县| 隆德县| 宁武县| 澄迈县| 壤塘县| 洛隆县| 会泽县| 那曲县| 昌都县| 田阳县|