07 2017 档案

摘要:这个模块还需要更多时间了解import randomimport curses'''By wumi 2017-7-23https://www.youtube.com/watch?v=rbasThWVb-cCurses 使用介绍:http://www.cnblogs.c... 阅读全文
posted @ 2017-07-23 15:52 yuerspring 阅读(414) 评论(0) 推荐(0)
摘要:#! /usr/bin/env python# coding:utf-8import random"""Guesser number ,by wumi ,2017-07-22"""def main(): print "guess a number between... 阅读全文
posted @ 2017-07-22 21:14 yuerspring 阅读(119) 评论(0) 推荐(0)
摘要:重点是什么是质数,以及怎么求质数#!/usr/bin/python# -*- coding:UTF-8 -*-'''Findprime number判断101-200之间有多少个素数,并输出所有素数。何为素数:质数(外文名prime number)又称素数,有无限个。... 阅读全文
posted @ 2017-07-18 23:23 yuerspring 阅读(201) 评论(0) 推荐(0)
摘要:#!/usr/bin/python# -*- coding:UTF-8 -*-import time"""pause for 2 seconds and format the timestamp"""def pause(n): for x in range(1... 阅读全文
posted @ 2017-07-18 22:35 yuerspring 阅读(182) 评论(0) 推荐(0)
摘要:两层数据嵌套#!/usr/bin/python# -*- coding:UTF-8 -*-""""print (9 9 ) --> Multiplication Table"""for x in range(1,10): print for k in r... 阅读全文
posted @ 2017-07-18 22:25 yuerspring 阅读(369) 评论(0) 推荐(0)
摘要:地址copy ,数据copy# -*- coding;utf-8 -*-#list copy"""将一个列表的数据复制到另一个列表中。核心就是浅拷贝还是深拷贝(地址 or 数据 )"""sourcelist = [11,333,444,555,6,7,6]print ... 阅读全文
posted @ 2017-07-18 22:24 yuerspring 阅读(151) 评论(0) 推荐(0)
摘要:#! /usr/bin/python# -*- coding:utf-8 -*-"""an interesting topic Fibonacci sequence"""#the method we know how to solve this issue ----... 阅读全文
posted @ 2017-07-18 22:19 yuerspring 阅读(144) 评论(0) 推荐(0)
摘要:# -*- coding:utf-8 -*-"""enter 3 unit ,and sort them"""L = []for x in range(3): L.append(int(raw_input("enter one unit data:\n")... 阅读全文
posted @ 2017-07-17 22:05 yuerspring 阅读(259) 评论(0) 推荐(0)
摘要:# -*- coding:utf-8 -*-"""计算当前时间是一年中的第几天"""bissextile = [31,60,91,121,152,182,213,244,274,305,335,366] #leap yearcommonYear =[31,59,... 阅读全文
posted @ 2017-07-17 22:04 yuerspring 阅读(653) 评论(0) 推荐(0)
摘要:代码本身不难,难点在于解题方法,有点高中的感觉#! /usr/bin/python# -*- coding:utf-8 -*-from __future__ import division #----> 返回精确的商"""题目:一个整数,它加上100后是一个完全平... 阅读全文
posted @ 2017-07-17 18:11 yuerspring 阅读(465) 评论(0) 推荐(0)
摘要:题目内容来自网络 ,加入了个人理解的过程 ,和点评#! /usr/bin/python# -*- coding:utf-8 -*-"""request :题目:企业发放的奖金根据利润提成。利润(I)低于或等于10万元时,奖金可提10%;利润高于10万元,低于20万元时... 阅读全文
posted @ 2017-07-17 18:05 yuerspring 阅读(558) 评论(0) 推荐(0)
摘要:题目内容来自网络 ,加入了个人理解的过程 ,和点评 #!/usr/bin/python# -*- coding: UTF-8 -*-#Author : Wumi#题目:有四个数字:1、2、3、4,能组成多少个互不相同且无重复数字的三位数?各是多少?#程序分析:可填在百... 阅读全文
posted @ 2017-07-17 12:40 yuerspring 阅读(914) 评论(0) 推荐(0)
摘要:# -*- coding:utf-8 -*-# this module is used to testing json 's Encoding & Decoding,have funimport json#1.json.dumps 用于将 Python 对象编码成 J... 阅读全文
posted @ 2017-07-13 12:58 yuerspring 阅读(114) 评论(0) 推荐(0)
摘要:import ibm_dbimport xlrdconn = ibm_db.connect("catalogdb",'username','passwd')#Preparing and executing a single SQL statement in Pytho... 阅读全文
posted @ 2017-07-12 13:44 yuerspring 阅读(247) 评论(0) 推荐(0)
摘要:Python 一直被炒得热火朝天,就像这炙热的天气,也像老谭酸菜 或是那茅台愈久弥香 也像洋槐花清新淡雅一下代码参考 文章 http://www.tuicool.com/articles/YNzqu2j 实现 ,代码还需要优化 ,不是效率 ,是功能不完善 一点心... 阅读全文
posted @ 2017-07-02 17:10 yuerspring 阅读(306) 评论(0) 推荐(0)