![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python程序
二代超人
刚刚步入社会的大学生
展开
-
python实现插入排序
#coding: UTF-8 def arrage(temp_list): num = len(temp_list) for i in range(1,num): for j in range(i): if temp_list[i] >= temp_list[j] and j == (i-1): bre原创 2015-04-13 09:29:02 · 572 阅读 · 0 评论 -
python 转换数字为钱数
目标: 输入一串数字,将其输出为几元几角几分 程序: #!/usr/bin/env python #coding:utf8 num_dict = {'1':'一','2':'二','3':'三','4':'四','5':'五', '6':'六','7':'七','8':'八','9':'九'} money_dict = {'-2':'分','-1':'角','0':原创 2015-04-13 10:09:08 · 3866 阅读 · 1 评论 -
python 实现选择排序
#coding:utf8 def sort(start_list): num = len(start_list) for i in range(num-1): min = i for j in range((i+1),num): if start_list[j] < start_list[min]:原创 2015-04-13 22:57:09 · 665 阅读 · 0 评论 -
Python 输出斐波纳挈数列
#!/usr/bin/env python #coding:utf8 import time global_list = [] def test(n): global global_list if n==1 or n==2: return 1 else: temp = test(n-1) + test(n-2) if i原创 2015-04-14 21:07:05 · 1042 阅读 · 0 评论 -
python 使用epoll异步处理多个客户端的连接
服务器端: #-*- coding:utf8 -*- import socket import select import os address = "0.0.0.0" port = 10001 sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM) def main(): global address,port,sock原创 2015-04-16 12:38:42 · 2511 阅读 · 1 评论