Python挑战游戏( PythonChallenge)闯关之路Level 0
来源:互联网 发布:淘宝运营公开课 编辑:程序博客网 时间:2024/06/13 11:08
关卡入口地址:http://www.pythonchallenge.com/pc/def/0.html
打开这个页面之后如下:
根据上面的提示,就是说把图画上内容的结果,计算出来,转换为url就OK了
为了练习呢,这一关,虽然简单, 但是还是用程序写一下把
#coding:utf-8import urllib2class PythonChallege:def level0(self):url_level_0='http://www.pythonchallenge.com/pc/def/0.html'#第0关的网址next_level_tips=str(2**38)#提示信息be_replace_str=url_level_0.split('/')[-1].split('.')[0]#要被替换的内容print be_replace_str+" will be replace"next_level_url=url_level_0.replace(be_replace_str,next_level_tips)#下一关网址print 'next level url is :'+next_level_urlif urllib2.urlopen(next_level_url).code == 200:print 'get right url'mychallenge=PythonChallege()mychallenge.level0()
结果如下:
0 will be replacenext level url is :http://www.pythonchallenge.com/pc/def/274877906944.htmlget right url
0 0
- Python挑战游戏( PythonChallenge)闯关之路Level 0
- Python挑战游戏( PythonChallenge)闯关之路Level- 1
- Python挑战游戏( PythonChallenge)闯关之路Level- 2
- Python挑战游戏( PythonChallenge)闯关之路Level- 3
- Python挑战游戏( PythonChallenge)闯关之路Level- 4
- Python挑战游戏( PythonChallenge)闯关之路Level- 5
- Python挑战游戏( PythonChallenge)闯关之路Level- 6
- PythonChallenge 挑战之路 Level-0
- PythonChallenge 挑战之路 Level-1
- PythonChallenge 挑战之路 Level-2
- PythonChallenge 挑战之路 Level-3
- PythonChallenge 挑战之路 Level-4
- PythonChallenge 挑战之路 Level-5
- PythonChallenge 挑战之路 Level-6
- PythonChallenge 挑战之路 Level-7
- PythonChallenge 挑战之路 Level-8
- PythonChallenge 挑战之路 Level-9
- PythonChallenge 挑战之路 Level-10
- servlet中获取XMLHttpRequest提交的FormData参数
- 数据结构---树的应用----二叉排序树(查找)
- jsp中给table增加删除、修改
- 智能巡逻兵
- oninput/ onpropertychange仿淘宝搜索框
- Python挑战游戏( PythonChallenge)闯关之路Level 0
- Android开发工具之Android Studio-合并主干和分支代码
- nginx 用lua中获取url路径相关信息
- android textview 自动换行 整齐排版
- JS实现页面刷新的几种方法
- Spring In Action<三>
- Cannot set property 'value' of null
- mysql sum count 解决 null 问题
- 谷歌深度学习公开课学习笔记(2)