- 博客(13)
- 收藏
- 关注
原创 查看pip安装的包的安装时间
print("软件包{}的安装时间:{}".format(package_name, install_time))# 遍历每个软件包,并输出其安装日期和时间。# 按照安装时间对软件包进行倒序排序。# 获取已安装的所有软件包的列表。
2023-07-15 16:42:08
2653
1
原创 python创建二维数组
二维数组指 x行y列 矩阵创建方式 m=[[0 for j in range(y)] for i in range (x) ]对矩阵进行修改举例:m[i][j]=1重复与列表解析构造矩阵对比:m=[[]]*3m[0].append(1)m[1].append(2)print(m)''' output:[[1, 2], [1, 2], [1, 2]]'''c=[[] for i in range(2)]c[0].append(1)print(c)'''...
2022-05-29 11:01:00
734
原创 python self问题
加了self可以全局使用如:self.work=.. 可以在多个方法使用(也不需要在init中)不加self的变量,若是在方法内,那么只能在这个方法中使用,若在init之前,则全局可用。方法中,对变量进行赋值,例如c=12,仅在方法中起作用,影响不了项目中的变量c...
2022-05-28 11:48:06
146
原创 python练习5.27
1.q3:'''Question:With a given integral number n, write a program to generate a dictionary that contains (i, i*i) such that is an integral number between 1 and n (both included). and then the program should print the dictionary.Suppose the follow.
2022-05-27 11:18:04
158
原创 python学习笔记2022.5.26
1.反斜杠可以用来转义,使用r可以让反斜杠不发生转义。 如r"this is a line with \n"则\n会显示,并不是换行。2.Python 通常是一行写完一条语句,但如果语句很长,我们可以使用反斜杠\来实现多行语句,例如:total = item_one + \ item_two + \ item_three3.在 [], {}, 或 () 中的多行语句,不需要使用反斜杠\ 4.Python 可以在同一行中使用多条语句,语句之...
2022-05-27 09:36:57
120
原创 python练习题5.26
1."""Question:Write a program which will find all such numbers which are divisible by 7 but are not a multiple of 5,between 2000 and 3200 (both included).The numbers obtained should be printed in a comma-separated sequence on a single line."""a=lis
2022-05-27 09:35:29
114
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅