Recent Changes - Search:

PythonChallenge4

(:source lang=python:)

  1. !/usr/bin/env python

import urllib2 import re

def follow(nothing):

    result = urllib2.urlopen('http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=%s' % (nothing)).read()
    print result
    new = re.findall('and the next nothing is ([0-9]*)', result)
    return new[0]

if __name__ == "__main__":

  1. nothing = '12345'
    nothing = '8022'

    while True:
        nothing = follow(nothing)

(:sourceend:)

Page last modified by brett on May 04, 2012, at 11:01 PM