摘要:输入:20170320,输出:20170220
阅读全文
摘要:1 # -*- coding:utf-8 -*- 2 from gevent import monkey 3 monkey.patch_all() 4 5 import urllib2 6 from gevent.pool import Pool 7 8 import requests 9 import re 10 11 class SpiderProxy: 12 ...
阅读全文
摘要:1 def to_str(n, base): 2 convert_string = "0123456789ABCDEF" 3 if n < base: 4 return convert_string[n] 5 else: 6 return to_str(n / base, base) + convert_string[n % base] 7...
阅读全文
摘要:形似1223221,12521均为回文数,给一个正整数你, 求所有这样的五位和六位的十进制数,满足个位数字之和等于n(5<=n<=54)。
阅读全文
摘要:1 # -*- coding:utf-8 -*- 2 class Node: 3 def __init__(self, initdata): 4 self.data = initdata 5 self.next = None 6 7 def getData(self): 8 return self....
阅读全文
摘要:1 # -*- coding:utf-8 -*- 2 import random 3 4 # best of three 5 def finger_guess(): 6 rule = {1:'rock', 2:'paper', 3:'scissor'} 7 win_way = [['rock', 'scissor'], ['paper', 'rock'], ['s...
阅读全文
摘要:'''思路:使用百度的文本转音频API,将结果保存成mp3格式,并用mp3play库播放该文件。''' 1 # -*- coding:utf-8 -*- 2 import sys 3 import requests 4 import json 5 import mp3play 6 import time 7 8 def talk(info): 9 appkey = "e...
阅读全文