Skip to content

Instantly share code, notes, and snippets.

@jezinka

jezinka/4.py Secret

Created July 29, 2017 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jezinka/ffb4a0b76f375082add63b257635979e to your computer and use it in GitHub Desktop.
Save jezinka/ffb4a0b76f375082add63b257635979e to your computer and use it in GitHub Desktop.
import re
import urllib
param = str(12345)
while (True):
try:
url = "http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=" + param
page_content = urllib.urlopen(url).read()
print page_content
param = re.findall("nothing is (\d+)", page_content)[0]
except IndexError:
if page_content.endswith('.html'):
break
param = str(int(param)/2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment