摘要: 搬家喽 阅读全文
posted @ 2018-12-26 11:04 hopelv 阅读(70) 评论(0) 推荐(0) 编辑
摘要: 引用地址http://www.runoob.com/python/os-file-methods.html 阅读全文
posted @ 2018-12-25 19:22 hopelv 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 56、画图,学用circle画圆形from tkinter import *canvas = Canvas(width=800, height=600, bg='yellow')canvas.pack(expand=YES, fill=BOTH)k = 1j... 阅读全文
posted @ 2018-12-24 18:06 hopelv 阅读(684) 评论(0) 推荐(0) 编辑
摘要: 44、两个 3 行 3 列的矩阵,实现其对应位置的数据相加,并返回一个新矩阵import numpy # pip install numpy 需要安装模块 ,支持大量的维度数组与矩阵运算x = numpy.array([[12, 7, 3], [4, 5... 阅读全文
posted @ 2018-12-24 08:40 hopelv 阅读(913) 评论(0) 推荐(0) 编辑
摘要: 1、列表转换为字典。`s=[1,2]b=['a','b']print (dict([s,b]))`2、#题目:有四个数字:1、2、3、4,能组成多少个互不相同且无重复数字的三位数?各是多少?for i in range(1,5): for j in ... 阅读全文
posted @ 2018-12-18 11:19 hopelv 阅读(357) 评论(0) 推荐(0) 编辑
摘要: 11、题目:判断101-200之间有多少个素数,并输出所有素数。#质数只能被1和自己本身整除,也称为素数for i in range(101,201): for k in range(2,i): if i%k==0: ... 阅读全文
posted @ 2018-12-18 09:59 hopelv 阅读(1277) 评论(0) 推荐(0) 编辑
摘要: python中时间日期格式化符号:%y 两位数的年份表示(00-99)%Y 四位数的年份表示(000-9999)%m 月份(01-12)%d 月内中的一天(0-31)%H 24小时制小时数(0-23)%I 12小时制小时数(01-12)%M 分钟数(00=5... 阅读全文
posted @ 2018-12-14 14:33 hopelv 阅读(345) 评论(0) 推荐(0) 编辑
摘要: 集合:可变的数据类型,他里面的元素必须是不可变的数据类型,无序,不重复。 {}'''# set1 = set({1,2,3})# set2 = {1,2,3,[2,3],{'name':'alex'}} # 错的# print(set1)# pri... 阅读全文
posted @ 2018-12-13 09:12 hopelv 阅读(88) 评论(0) 推荐(0) 编辑
摘要: lis = [11,22,33,44,55]# for i in range(len(lis)):# print(i) # i = 0 i = 1 i = 2# del lis... 阅读全文
posted @ 2018-12-12 17:36 hopelv 阅读(89) 评论(0) 推荐(0) 编辑
摘要: 函数命名空间# 函数进阶# a = 1# def func():# print(a)# func()# 命名空间和作用域# print()# input()# list# tuple#命名空间 有三种#内置命名空间 —— python解释器 #... 阅读全文
posted @ 2018-12-12 17:34 hopelv 阅读(122) 评论(0) 推荐(0) 编辑