摘要: timestamp与datetime的转换 datetime加减:timedelta; 100天前是几号?今年还有多少天? 编写一个函数将字符串‘2017年10月9日星期一9时10分0秒 UTC+8:00’转换为timestamp。 1管理有不同层次所需信息各有什么特点? 战略级:关系到上层决策的信 阅读全文
posted @ 2017-10-10 11:08 003刘淑千 阅读(149) 评论(0) 推荐(0) 编辑
摘要: >>> from datetime import datetime >>> spt =datetime.strptime('2017/9/30','%Y/%m/%d') >>> spt datetime.datetime(2017, 9, 30, 0, 0) >>> spt2 =datetime.strptime('2017年9月30日星期六','%Y年%m月%d日星期六') >>> spt2 ... 阅读全文
posted @ 2017-09-30 09:56 003刘淑千 阅读(209) 评论(0) 推荐(0) 编辑
摘要: import jieba txt = open('test.txt','r',encoding='utf-8').read() words= list(jieba.cut(txt)) dic={} for w in words: if len(w)==1: continue else: dic[w] = dic.get(w,0)+1 wc = ... 阅读全文
posted @ 2017-09-29 10:36 003刘淑千 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 原来 新的 阅读全文
posted @ 2017-09-26 09:54 003刘淑千 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 建立学生学号成绩字典,做增删改查遍历操作。 列表元组字典集合的遍历 总结列表,元组,字典,集合的联系与区别。 (1)列表用方括号表示,随时可以增删查改。 (2)元组用圆括号表示。元组和列表的大部分操作相同。不同于元组初始后就不能更改。 (3)与列表和元组不同,集合是无序的,也不能通过索引进行访问。集 阅读全文
posted @ 2017-09-22 12:50 003刘淑千 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 实例: 下载一首英文的歌词或文章,将所有,.?!替换为空格,将所有大写转换为小写,统计某几个单词出现的次数,分隔出一个一个的单词。 实例:由字符串创建一个作业评分列表,做增删改查询统计遍历操作。全部改为数值型查询第一个3分的下标1分的同学有多少个,3分的同学有多少个 简要描述列表与元组的异同。 元组 阅读全文
posted @ 2017-09-20 16:04 003刘淑千 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 恺撒密码的编码 国家名称 GDP总量(人民币亿元)中国 ¥765873.4375澳大利亚 ¥ 78312.4375(国家名称左对齐,数字右对齐,千分位,2位小数 阅读全文
posted @ 2017-09-19 10:37 003刘淑千 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 输入学号,识别年级、专业、班级、序号 已知‘星期一星期二星期三星期四星期五星期六星期日 ’,输入数字(1-7),输出相应的‘星期几’ 输入身份证号,识别地区、年龄、性别 len(),eval(),+,*,in,chr() 转义\n\t\\ 输出全部的星座符号,以反斜线分隔。 https://docs 阅读全文
posted @ 2017-09-15 13:32 003刘淑千 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 五角星 from turtle import *color ('yellow')bgcolor('red')fillcolor('yellow')begin_fill()for i in range(5): forward(90) right(144) end_fill() 同心圆 import t 阅读全文
posted @ 2017-09-12 10:37 003刘淑千 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 同切圆 >>> import turtle>>> turtle.circle(50)>>> turtle.circle(70) 同心圆 import turtle >>> turtle.circle(100)>>> turtle.up()>>> turtle.goto(0,-100)>>> turt 阅读全文
posted @ 2017-09-08 18:24 003刘淑千 阅读(115) 评论(0) 推荐(0) 编辑