python challenge
from: http://www.cnblogs.com/jimnox/archive/2009/12/08/tips-to-python-challenge.html
Python ChallengeÊÇÒ»¸öÍøÒ³´³¹ØÓÎÏ·£¬Í¨¹ýһЩÌáʾÕÒ³öÏÂÒ»¹ØµÄÍøÒ³µØÖ·¡£ÓëÖÚ²»Í¬µÄÊÇ£¬ËüÊÇרÃÅΪ³ÌÐòÔ±Éè¼ÆµÄ£¬ÒòΪ´ó¶àÊý¹Ø¿¨¶¼Òª±à³ÌÀ´ËãŶ£¡£¡
È¥ÄêºÍͬѧһÆðÍæµÄ£¬Ëû×öÁË´ó°ë£¬ÎÒ×öÁËС°ë£¬×÷±×ÁËһЩ£¬33¹Øȫͨ£¬½ñÌì¹äÓ²ÅÌ·¢ÏÖÕâ¸ö×ÊÁÏ£¬ÄóöÀ´»Î»Î¡£
·Ç³£·Ç³£·Ç³£·Ç³£ºÃÍ棬ǿÁÒÍƼö±à³ÌµÄÅóÓѶ¼ÍæÍ棬²»Ò»¶¨Òª»áPython£¬ÎÒºÍÎÒͬѧ¶¼²»»á£¬²»¹ýÎÒÃÇÓÃC#Ò»ÑùÄܸã³öÀ´£¬Ã»ÓÐÕÏ°µÄ¡£
0
http://www.pythonchallenge.com/pc/def/0.html
²Â238£¬ËµÊÇ38ÔÚ2ÉÏÃæÒ»µãµã£¬²Â238= 274877906944£¬½øÈëÏÂÒ»¹Ø
1
http://www.pythonchallenge.com/pc/def/274877906944.html
http://www.pythonchallenge.com/pc/def/map.html
¸ù¾ÝͼÉϵÄÌáʾ£¬ÊÇλÒƼÓÃÜ£¬Ã¿¸ö×Ö·ûλÒÆÁ½´Î£¬°ÑÏÂÃæÄÇЩÌáʾÓÃÕâ¸ö·½·¨µÄ´¦Àí£¬¸æËßÎÒÓÃͬÑùµÄ·½·¨´¦Àíurl£¬µÃµ½ocr
2
http://www.pythonchallenge.com/pc/def/ocr.html
Ìáʾ¿´Ô´Îļþ£¬Ò»´ó¶Ñ×Ö·û£¬ËµÒªÕÒµ½³öÏÖ´ÎÊý×îÉÙµÄ×Ö·û£¬·¢ÏÖÊÇequality
3
http://www.pythonchallenge.com/pc/def/equality.html
Ò»¸öСд×Öĸ£¬Ã¿±ß¸ÕºÃÓÐÈý¸ö´óд×Öĸ×ö±£ïÚ¡£
XXX
XxX
XXX
X
X
XXXxXXX
X
X
xXXXxXXXx Õâ¸ö²ÅÊǶԵą…
ÕÒµ½µÄ´ð°¸ÊÇlinkedlist
4
http://www.pythonchallenge.com/pc/def/linkedlist.html
http://www.pythonchallenge.com/pc/def/linkedlist.php
µã»÷ÍøÒ³ÉϵÄͼƬ֮ºó£¬½øÈëÁ¬½Ó
http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=12345
Ìáʾand the next nothing is 92512
È»ºó¾Í°Ñ12345¸Ä³É92512£¬ËûÓÖÌáʾand the next nothing is 64505……
¾ÍÕâôһ·ÏÂÈ¥£¬ÕÕ×ÅÌáʾ£¬¼¸°Ù´ÎÖ®ºó¾ÍÐÐÁË……
5
http://www.pythonchallenge.com/pc/def/peak.html
peak hell˵Ҫ¶Á³öÀ´£¬pickle
ÏÂÔØbanner.p
È»ºó¾ÍÓÖ²»»áÁË……
6
http://www.pythonchallenge.com/pc/def/channel.html
´ÓͼƬ¿´³ö£¬ÀÁ´(zip)ÊÇÖ÷½Ç……
ÏÂÔØchannel.zip
È»ºóºÍµÚ4¹Ø²î²»¶à£¬×ö¸ö³ÌÐòһ·×ßÏÂÈ¥¡£
È»ºó¾Ý˵ÓÐ×¢ÊÍ£¬µ«ÊÇÎÒÕÒ²»µ½……
7
http://www.pythonchallenge.com/pc/def/oxygen.html
ͼƬÉϵÄÄÇÌõ»Ò¶È°´ÕÕASCII½âÂë³öÀ´ºóÊÇintegrity
8
http://www
Ïà¹ØÎĵµ£º
PythonÄÚ½¨Òì³£Ìåϵ½á¹¹
BaseException
+--¡¡SystemExit
+--¡¡KeyboardInterrupt
+--¡¡GeneratorExit
+--¡¡Exception
+--¡¡StopIteration
+--¡¡StandardError
|¡¡¡¡¡¡¡¡+--¡¡BufferError
|¡¡¡¡¡¡¡¡+--¡¡ArithmeticError
|¡¡¡¡¡¡¡¡|¡¡¡¡¡¡¡¡+--¡¡FloatingPointError
|¡¡¡¡¡¡¡¡|¡¡¡¡¡¡¡¡+--¡¡OverflowError
|¡¡¡¡ ......
def retrive_emails(pop3_server, user_name, passwd, server_port):
#POP3
pop_client = poplib.POP3(pop3_server, port=server_port)
pop_client.user(user_name)
pop_client.pass_(passwd)
......
Python ÊÇÃâ·ÑµÄ½âÊÍÐÔÓïÑÔ£¬¾ßÓÐÃæÏò¶ÔÏóµÄÌØÐÔ¡£¿ÉÒÔÔËÐÐÔÚ¶àÖÖ²Ù×÷ϵͳ֮ÉÏ£¬Python¾ßÓÐÇåÎúµÄ½á¹¹£¬¼ò½àµÄÓï·¨ÒÔ¼°Ç¿´óµÄ¹¦ÄÜ¡£Python¿ÉÒÔÍê³É´ÓÎı¾´¦Àíµ½ÍøÂçͨÐŵȸ÷ÖÖ¹¤×÷£¬python×ÔÉíÒѾÌṩÁË´óÁ¿µÄÄ£¿éÀ´ÊµÏÖ¸÷ÖÖ¹¦ÄÜ£¬³ý´ËÒÔÍ⻹¿ÉÒÔʹÓÃC/C++À´À©Õ¹Python£¬ÉõÖÁ»¹¿ÉÒÔ½«PythonǶÈëµ½ÆäËûÓ ......
»°ËµPython£¨¶þ£©
×Ô´ÓС°×ÉÏÍêµÚÒ»¿Î£¬Python¼òÖ±³ÉÁËËûµÄ¿Æѧ¼ÆËãÆ÷¡£Ã¿ÌìÔçÉÏ£¬Ð¡°××ÜÊDz»Íü“Á·Ï°”Ò»ÏÂPython¡£
>>> 10000*1.2**40
14697715.679690843
“ºÙºÙ£¬ÎÒ·¢´ïÁË£¡”С°×ÔÚɵЦ×Å£¬ºÃÏñÔÚ×öÃΣ¬“ËÄÊ®Äêºó¾ÍÊÇÒÚÍò¸»ÎÌÀ²!”
С²ËÇÃÁËÇÃС°×µ ......
import urllib2
import time
import socket
from datetime import datetime
from thread_pool import *
def main():
url_list = {"sina":"http://www.sina.com.cn",
"sohu":"http://www.sohu.com",
"yahoo":"http://www.yahoo.com",
"xiaonei":"http://www.x ......