Python程序开发入门(第五章)字典(Dictionary)及日期和时间
off999 2024-10-13 04:21 82 浏览 0 评论
第五章
Python字典(Dictionary)及日期和时间
5.1 Python字典(Dictionary)
Python字典是另一种可变容器模型,且可存储任意类型对象。字典的每个键值 key=>value 对用冒号:分割,每个键值对之间用逗号,分割,整个字典包括在花括号{}中 ,格式如下所示:
d = {key1 : value1, key2 : value2 }
键一般是唯一的,如果重复最后的一个键值对会替换前面的,值不需要唯一。
>>> dict = {'a': 1, 'b': 2, 'b': '3'}
>>> dict['b']
'3'
>>> dict
{'a': 1, 'b': '3'}
值可以取任何数据类型,但键必须是不可变的,如字符串,数字或元组。
一个简单的字典实例:
dict = {'Alice': '2341', 'Beth': '9102', 'Cecil': '3258'}
也可如此创建字典:
dict1 = { 'abc': 456 } dict2 = { 'abc': 123, 98.6: 37 }
5.1.1 访问字典里的值
把相应的键放入熟悉的方括弧,如下实例:
#!/usr/bin/python
dict = {'Name': 'Zara', 'Age': 7, 'Class': 'First'}
print ("dict['Name']: ", dict['Name'])
print ("dict['Age']: ", dict['Age'])
以上实例输出结果:
dict['Name']: Zara
dict['Age']: 7
如果用字典里没有的键访问数据,会输出错误如下:
#!/usr/bin/python
dict = {'Name': 'Zara', 'Age': 7, 'Class': 'First'}
print ("dict['Alice']: ", dict['Alice'])
以上实例输出结果:
dict['Alice']:
Traceback (most recent call last):
File "test.py", line 5, in <module>
print "dict['Alice']: ", dict['Alice']
KeyError: 'Alice'
5. 1.2 修改字典
向字典添加新内容的方法是增加新的键/值对,修改或删除已有键/值对如下实例:
#!/usr/bin/python
dict = {'Name': 'Zara', 'Age': 7, 'Class': 'First'}
dict['Age'] = 8 # 更新
dict['School'] = "RUNOOB" # 添加
print ("dict['Age']: ", dict['Age'])
print ("dict['School']: ", dict['School'])
以上实例输出结果:
dict['Age']: 8
dict['School']: RUNOOB
5. 1.3 删除字典元素
能删单一的元素也能清空字典,清空只需一项操作。显示删除一个字典用del命令,如下实例:
#!/usr/bin/python
# -*- coding: UTF-8 -*-
dict = {'Name': 'Zara', 'Age': 7, 'Class': 'First'}
del dict['Name'] # 删除键是'Name'的条目
dict.clear() # 清空字典所有条目
del dict # 删除字典
print ("dict['Age']: ", dict['Age'])
print ("dict['School']: ", dict['School'])
但这会引发一个异常,因为用del后字典不再存在:
dict['Age']:
Traceback (most recent call last):
File "test.py", line 8, in <module>
print "dict['Age']: ", dict['Age']
TypeError: 'type' object is unsubscriptable
(注:del()方法后面也会讨论。)
5. 1.4 字典键的特性
字典值可以没有限制地取任何python对象,既可以是标准的对象,也可以是用户定义的,但键不行。
两个重要的点需要记住:
(1)不允许同一个键出现两次。创建时如果同一个键被赋值两次,后一个值会被记住,如下实例:
#!/usr/bin/python
dict = {'Name': 'Zara', 'Age': 7, 'Name': 'Manni'}
print ("dict['Name']: ", dict['Name'])
以上实例输出结果:
dict['Name']: Manni
(2)键必须不可变,所以可以用数字,字符串或元组充当,所以用列表就不行,如下实例:
#!/usr/bin/python
dict = {['Name']: 'Zara', 'Age': 7}
print ("dict['Name']: ", dict['Name'])
以上实例输出结果:
Traceback (most recent call last):
File "test.py", line 3, in <module>
dict = {['Name']: 'Zara', 'Age': 7}
TypeError: list objects are unhashable
5. 1.5 字典内置函数&方法
Python字典包含了以下内置函数:
序号 | 函数及描述 |
1 | cmp(dict1, dict2) 比较两个字典元素。 |
2 | len(dict) 计算字典元素个数,即键的总数。 |
3 | str(dict) 输出字典可打印的字符串表示。 |
4 | type(variable) 返回输入的变量类型,如果变量是字典就返回字典类型。 |
Python字典包含了以下内置方法:
序号 | 函数及描述 |
1 | dict.clear() 删除字典内所有元素 |
2 | dict.copy() 返回一个字典的浅复制 |
3 | dict.fromkeys(seq[, val]) 创建一个新字典,以序列 seq 中元素做字典的键,val 为字典所有键对应的初始值 |
4 | dict.get(key, default=None) 返回指定键的值,如果值不在字典中返回default值 |
5 | dict.has_key(key) |
6 | dict.items() 以列表返回可遍历的(键, 值) 元组数组 |
7 | dict.keys() 以列表返回一个字典所有的键 |
8 | dict.setdefault(key, default=None) |
9 | dict.update(dict2) 把字典dict2的键/值对更新到dict里 |
10 | dict.values() 以列表返回字典中的所有值 |
11 | pop(key[,default]) 删除字典给定键 key 所对应的值,返回值为被删除的值。key值必须给出。 否则,返回default值。 |
12 | popitem() 返回并删除字典中的最后一对键和值。 |
5. 2 python日期和时间
Python 程序能用很多方式处理日期和时间,转换日期格式是一个常见的功能。Python 提供了一个 time 和 calendar 模块可以用于格式化日期和时间,时间间隔是以秒为单位的浮点小数,每个时间戳都以自从1970年1月1日午夜(历元)经过了多长时间来表示,但最长不能超过2038年。
5. 2.1 Time(时间) 模块
Time 模块包含了以下内置函数,既有时间处理的,也有转换时间格式的:
序号 | 函数及描述 |
1 | time.altzone |
2 | time.asctime([tupletime]) |
3 | time.clock( ) |
4 | time.ctime([secs]) |
5 | time.gmtime([secs]) |
6 | time.localtime([secs]) |
7 | time.mktime(tupletime) |
8 | time.sleep(secs) |
9 | time.strftime(fmt[,tupletime]) |
10 | time.strptime(str,fmt='%a %b %d %H:%M:%S %Y') |
11 | time.time( ) |
12 | time.tzset() |
Time模块包含了以下2个非常重要的属性:
序号 | 属性及描述 |
1 | time.timezone |
2 | time.tzname |
5. 2.1.1 altzone()函数
函数返回格林威治西部的夏令时地区的偏移秒数。如果该地区在格林威治东部会返回负值(如西欧,包括英国)。对夏令时启用地区才能使用。
altzone()方法语法:
time.altzone
以下实例展示了 altzone()函数的使用方法:
#!/usr/bin/python
# -*- coding: GBK -*-
import time
print ("time.altzone %d " % time.altzone)
以上实例输出结果为:
time.altzone -32400
5. 2.1.2 asctime ()(获取格式化的时间函数)
我们可以根据需求选取各种时间格式,但是最为简单获取可读的时间模式的函数是asctime():
实例
#!/usr/bin/python
# -*- coding: GBK -*-
import time
localtime = time.asctime( time.localtime(time.time()) )
print("本地时间为 :", localtime)
以上实例输出结果:
本地时间为 : Mon Nov 29 09:38:45 2021
5. 2.1.3 clock() 函数
Python 3.8 已移除 clock() 方法 可以使用 time.perf_counter() 或 time.process_time() 方法替代。
Python time.clock() 函数以浮点数计算的秒数返回当前的CPU时间。用来衡量不同程序的耗时,比time.time()更有用。
这个需要注意,在不同的系统上含义不同。在UNIX系统上,它返回的是"进程时间",它是用秒表示的浮点数(时间戳)。而在WINDOWS中,第一次调用,返回的是进程运行的实际时间。而第二次之后的调用是自第一次调用以后到现在的运行时间。(实际上是以WIN32上QueryPerformanceCounter()为基础,它比毫秒表示更为精确)
clock()方法语法:
time.clock()
该函数有两个功能:在第一次调用的时候,返回的是程序运行的实际时间;以第二次之后的调用,返回的是自第一次调用后,到这次调用的时间间隔。在win32系统下,这个函数返回的是真实时间(wall time),而在Unix/Linux下返回的是CPU时间。
以下实例展示了 clock()函数的使用方法:
实例
#!/usr/bin/python
import time
def procedure():
time.sleep(2.5)
# measure process time
t0 = time.clock()
procedure()
print (time.clock() - t0, "seconds process time")
# measure wall time
t0 = time.time()
procedure()
print (time.time() - t0, "seconds wall time")
以上实例输出结果为:
2.4992738537751906 seconds process time
2.500143051147461 seconds wall time
5. 2.1.4 ctime() 函数
Time.ctime() 函数把一个时间戳(按秒计算的浮点数)转化为time.asctime()的形式。如果参数未给或者为None的时候,将会默认time.time()为参数。它的作用相当于asctime(localtime(secs))。
ctime()方法语法:
time.ctime([ sec ])
参数sec -- 要转换为字符串时间的秒数。
以下实例展示了 ctime() 函数的使用方法:
#!/usr/bin/python
# -*- coding: GBK -*-
import time
print ("time.ctime() : %s" % time.ctime())
以上实例输出结果为:
time.ctime() : Mon Nov 29 14:00:24 2021
5. 2.1.5 gmtime()
Time.gmtime() 函数将一个时间戳转换为UTC时区(0时区)的struct_time,可选的参数sec表示从1970-1-1以来的秒数。其默认值为time.time(),函数返回time.struct_time类型的对象。(struct_time是在time模块中定义的表示时间的对象)。
gmtime()方法语法:
time.gmtime([ sec ])
参数sec -- 转换为time.struct_time类型的对象的秒数。
以下实例展示了 gmtime() 函数的使用方法:
#!/usr/bin/python
# -*- coding: GBK -*-
import time
print ("time.gmtime() : ",time.gmtime())
以上实例输出结果为:
time.gmtime(): time.struct_time(tm_year=2021, tm_mon=11, tm_mday=29, tm_hour=6,
tm_min=14, tm_sec=9, tm_wday=0, tm_yday=333, tm_isdst=0)
5. 2.1.6 localtime()(获取当前时间函数)
从返回浮点数的时间戳方式向时间元组转换,只要将浮点数传递给如localtime之类的函数。
实例
#!/usr/bin/python
# -*- coding: GBK -*-
import time
localtime = time.localtime(time.time())
print ("本地时间为 :", localtime)
以上实例输出结果:
本地时间为 : time.struct_time(tm_year=2021, tm_mon=11, tm_mday=29, tm_hour=9, tm
_min=33, tm_sec=26, tm_wday=0, tm_yday=333, tm_isdst=0)
5. 2.1.7 mktime()
Time.mktime() 函数执行与gmtime(), localtime()相反的操作,它接收struct_time对象作为参数,返回用秒数来表示时间的浮点数。
如果输入的值不是一个合法的时间,将触发 OverflowError 或 ValueError。
mktime()方法语法:
time.mktime(t)
参数t -- 结构化的时间或者完整的9位元组元素。
返回值:返回用秒数来表示时间的浮点数。
以下实例展示了 mktime() 函数的使用方法:
实例
#!/usr/bin/python
import time
t = (2009, 2, 17, 17, 3, 38, 1, 48, 0)
secs = time.mktime( t )
print ("time.mktime(t) : %f" % secs)
print ("asctime(localtime(secs)): %s" % time.asctime(time.localtime(secs)))
以上实例输出结果为:
time.mktime(t) : 1234861418.000000
asctime(localtime(secs)): Tue Feb 17 17:03:38 2009
5. 2.1.8 sleep()函数
Time.sleep() 函数推迟调用线程的运行,可通过参数secs指秒数,表示进程挂起的时间。
sleep()方法语法:
time.sleep(t)
参数t -- 推迟执行的秒数。
以下实例展示了 sleep() 函数的使用方法:
#!/usr/bin/python
import time
print ("Start : %s" % time.ctime())
time.sleep( 5 ) #上面执行完后,暂停5秒,再执行下面操作
print ("End : %s" % time.ctime())
以上实例输出结果为:
Start : %s Mon Nov 29 14:22:17 2021
End : %s Mon Nov 29 14:22:22 2021
5. 2.1.9 strftime()(格式化日期函数)
我们可以使用time.strftime(format[, t])方法来格式化日期:
实例
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import time # 格式化成2021-11-29 09:46:45形式
print (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())) # 格式化成Mon Nov 29 09:46:45 2021形式
print (time.strftime("%a %b %d %H:%M:%S %Y", time.localtime())) # 将格式字符串转换为时间戳
a = "Mon Nov 29 09:46:45 2021"
print (time.mktime(time.strptime(a,"%a %b %d %H:%M:%S %Y")))
以上实例输出结果:
2021-11-29 09:46:45
Mon Nov 29 09:46:45 2021
1638149925.0
5. 2.1.10 strptime
Time.strptime() 函数根据指定的格式把一个时间字符串解析为时间元组。
strptime()方法语法:
time.strptime(string[, format])
参数:
string -- 时间字符串。
format -- 格式化字符串。
返回值:
返回struct_time对象。
以下实例展示了 strptime() 函数的使用方法:
#!/usr/bin/python
# -*- coding: GBK -*-
import time
struct_time = time.strptime("30 Nov 00", "%d %b %y")
print ("返回的元组: " , struct_time)
以上实例输出结果为:
返回的元组: time.struct_time(tm_year=2000, tm_mon=11, tm_mday=30, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=3, tm_yday=335, tm_isdst=-1)
python中用于时间日期格式化符号:
格式化符号 | 实现功能 |
%y | 两位数的年份表示(00-99) |
%Y | 四位数的年份表示(000-9999) |
%m | 月份(01-12) |
%d | 月内中的一天(0-31) |
%H | 24小时制小时数(0-23) |
%I | 12小时制小时数(01-12) |
%M | 分钟数(00-59) |
%S | 秒(00-59) |
%a | 本地简化星期名称 |
%A | 本地完整星期名称 |
%b | 本地简化的月份名称 |
%B | 本地完整的月份名称 |
%c | 本地相应的日期表示和时间表示 |
%j | 年内的一天(001-366) |
%p | 本地A.M.或P.M.的等价符 |
%U | 一年中的星期数(00-53)星期天为星期的开始 |
%w | 星期(0-6),星期天为星期的开始 |
%W | 一年中的星期数(00-53)星期一为星期的开始 |
%x | 本地相应的日期表示 |
%X | 本地相应的时间表示 |
%Z | 当前时区的名称 |
%% | %号本身 |
5. 2.1.11 time()(获取当前时间戳函数)
Python 的 time 模块下有很多函数可以转换常见日期格式。如函数time.time()用于获取当前时间戳, 如下实例:
#!/usr/bin/python
# -*- coding: GBK -*-
import time # 引入time模块
ticks = time.time()
print ("当前时间戳为:", ticks)
上面实例输出结果:
当前时间戳为: 1638149010.1856701
时间戳单位最适于做日期运算。但是1970年之前的日期就无法以此表示了。超过2038年的日期也不行,因为目前UNIX和Windows只支持到2038年。
很多Python函数用一个元组装起来的9组数字处理时间:
序号 | 字段 | 值 |
0 | 4位数年 | 2008 |
1 | 月 | 1 到 12 |
2 | 日 | 1到31 |
3 | 小时 | 0到23 |
4 | 分钟 | 0到59 |
5 | 秒 | 0到61 (60或61 是闰秒) |
6 | 一周的第几日 | 0到6 (0是周一) |
7 | 一年的第几日 | 1到366 (儒略历) |
8 | 夏令时 | -1, 0, 1, -1是决定是否为夏令时的旗帜 |
上述也就是struct_time元组。这种结构具有如下属性:
序号 | 属性 | 值 |
0 | tm_year | 2008 |
1 | tm_mon | 1 到 12 |
2 | tm_mday | 1 到 31 |
3 | tm_hour | 0 到 23 |
4 | tm_min | 0 到 59 |
5 | tm_sec | 0 到 61 (60或61 是闰秒) |
6 | tm_wday | 0到6 (0是周一) |
7 | tm_yday | 1 到 366(儒略历) |
8 | tm_isdst | -1, 0, 1, -1是决定是否为夏令时的旗帜 |
5. 2.1.12 time.tzset()
Time.tzset() 根据环境变量TZ重新初始化时间相关设置。标准TZ环境变量格式:
std offset [dst [offset [,start[/time], end[/time]]]]
参数:
- std 和 dst:三个或者多个时间的缩写字母。传递给 time.tzname.
- offset: 距UTC的偏移,格式: [+|-]hh[:mm[:ss]] {h=0-23, m/s=0-59}。
- start[/time], end[/time]: DST 开始生效时的日期。格式为 m.w.d — 代表日期的月份、周数和日期。w=1 指月份中的第一周,而 w=5 指月份的最后一周。'start' 和 'end' 可以是以下格式之一:Jn: 儒略日 n (1 <= n <= 365)。闰年日(2月29)不计算在内。n: 儒略日 (0 <= n <= 365)。 闰年日(2月29)计算在内Mm.n.d: 日期的月份、周数和日期。w=1 指月份中的第一周,而 w=5 指月份的最后一周。time:(可选)DST 开始生效时的时间(24 小时制)。默认值为 02:00(指定时区的本地时间)。
语法: time.tzset()
以下实例展示了 tzset() 函数的使用方法:
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import time
import os
os.environ['TZ'] = 'EST+05EDT,M4.1.0,M10.5.0'
time.tzset()
print time.strftime('%X %x %Z')
os.environ['TZ'] = 'AEST-10AEDT-11,M10.5.0,M3.5.0'
time.tzset()
print time.strftime('%X %x %Z')
以上实例输出结果为:
13:00:40 02/17/09 EST
05:00:40 02/18/09 AEDT
5. 2.2 Calendar 模块(获取某月日历函数)
此模块的函数都是与日历相关的,例如打印某月的字符月历。星期一是默认的每周第一天,星期天是默认的最后一天。更改设置需调用calendar.setfirstweekday()函数。模块包含了以下内置函数:
序号 | 函数及描述 |
1 | calendar.calendar(year,w=2,l=1,c=6) |
2 | calendar.firstweekday( ) |
3 | calendar.isleap(year) 是闰年返回 True,否则为 False。 >>> import calendar >>> print(calendar.isleap(2000)) True >>> print(calendar.isleap(1900)) False |
4 | calendar.leapdays(y1,y2) |
5 | calendar.month(year,month,w=2,l=1) |
6 | calendar.monthcalendar(year,month) |
7 | calendar.monthrange(year,month) |
8 | calendar.prcal(year,w=2,l=1,c=6) |
9 | calendar.prmonth(year,month,w=2,l=1) |
10 | calendar.setfirstweekday(weekday) |
11 | calendar.timegm(tupletime) |
12 | calendar.weekday(year,month,day) |
Calendar模块有很广泛的方法用来处理年历和月历,例如打印某月的月历:
#!/usr/bin/python
# -*- coding: GBK -*-
import calendar
cal = calendar.month(2021, 1)
print ("以下输出2021年1月份的日历:")
print (cal)
以上实例输出结果:
以下输出2021年1月份的日历:
January 2021
Mo Tu We Th Fr Sa Su
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
相关推荐
- 安全教育登录入口平台(安全教育登录入口平台官网)
-
122交通安全教育怎么登录:122交通网的注册方法是首先登录网址http://www.122.cn/,接着打开网页后,点击右上角的“个人登录”;其次进入邮箱注册,然后进入到注册页面,输入相关信息即可完...
- 大鱼吃小鱼经典版(大鱼吃小鱼经典版(经典版)官方版)
-
大鱼吃小鱼小鱼吃虾是于谦跟郭麒麟的《我的棒儿呢?》郭德纲说于思洋郭麒麟作诗的相声,最后郭麒麟做了一首,师傅躺在师母身上大鱼吃小鱼小鱼吃虾虾吃水水落石出师傅压师娘师娘压床床压地地动山摇。...
-
- 哪个软件可以免费pdf转ppt(免费的pdf转ppt软件哪个好)
-
要想将ppt免费转换为pdf的话,我们建议大家可以下一个那个wps,如果你是会员的话,可以注册为会员,这样的话,在wps里面的话,就可以免费将ppt呢转换为pdfpdf之后呢,我们就可以直接使用,不需要去直接不需要去另外保存,为什么格式转...
-
2026-02-04 09:03 off999
- 电信宽带测速官网入口(电信宽带测速官网入口app)
-
这个网站看看http://www.swok.cn/pcindex.jsp1.登录中国电信网上营业厅,宽带光纤,贴心服务,宽带测速2.下载第三方软件,如360等。进行在线测速进行宽带测速时,尽...
- 植物大战僵尸95版手机下载(植物大战僵尸95 版下载)
-
1可以在应用商店或者游戏平台上下载植物大战僵尸95版手机游戏。2下载教程:打开应用商店或者游戏平台,搜索“植物大战僵尸95版”,找到游戏后点击下载按钮,等待下载完成即可安装并开始游戏。3注意:确...
- 免费下载ppt成品的网站(ppt成品免费下载的网站有哪些)
-
1、Chuangkit(chuangkit.com)直达地址:chuangkit.com2、Woodo幻灯片(woodo.cn)直达链接:woodo.cn3、OfficePlus(officeplu...
- 2025世界杯赛程表(2025世界杯在哪个国家)
-
2022年卡塔尔世界杯赛程公布,全部比赛在卡塔尔境内8座球场举行,2022年,决赛阶段球队全部确定。揭幕战于当地时间11月20日19时进行,由东道主卡塔尔对阵厄瓜多尔,决赛于当地时间12月18日...
- 下载搜狐视频电视剧(搜狐电视剧下载安装)
-
搜狐视频APP下载好的视频想要导出到手机相册里方法如下1、打开手机搜狐视频软件,进入搜狐视频后我们点击右上角的“查找”,找到自已喜欢的视频。2、在“浏览器页面搜索”窗口中,输入要下载的视频的名称,然后...
- 永久免费听歌网站(丫丫音乐网)
-
可以到《我爱音乐网》《好听音乐网》《一听音乐网》《YYMP3音乐网》还可以到《九天音乐网》永久免费听歌软件有酷狗音乐和天猫精灵,以前要跳舞经常要下载舞曲,我从QQ上找不到舞曲下载就从酷狗音乐上找,大多...
- 音乐格式转换mp3软件(音乐格式转换器免费版)
-
有两种方法:方法一在手机上操作:1、进入手机中的文件管理。2、在其中选择“音乐”,将显示出手机中的全部音乐。3、点击“全选”,选中所有音乐文件。4、点击屏幕右下方的省略号图标,在弹出菜单中选择“...
- 电子书txt下载(免费的最全的小说阅读器)
-
1.Z-library里面收录了近千万本电子书籍,需求量大。2.苦瓜书盘没有广告,不需要账号注册,使用起来非常简单,直接搜索预览下载即可。3.鸠摩搜书整体风格简洁清晰,书籍资源丰富。4.亚马逊图书书籍...
- 最好免费观看高清电影(播放免费的最好看的电影)
-
在目前的网上选择中,IMDb(互联网电影数据库)被认为是最全的电影网站之一。这个网站提供了各种类型的电影和电视节目的海量信息,包括剧情介绍、演员表、评价、评论等。其还提供了有关电影制作背后的详细信息,...
- 孤单枪手2简体中文版(孤单枪手2简体中文版官方下载)
-
要将《孤胆枪手2》游戏的征兵秘籍切换为中文,您可以按照以下步骤进行操作:首先,打开游戏设置选项,通常可以在游戏主菜单或游戏内部找到。然后,寻找语言选项或界面选项,点击进入。在语言选项中,选择中文作为游...
欢迎 你 发表评论:
- 一周热门
- 最近发表
- 标签列表
-
- python计时 (73)
- python安装路径 (56)
- python类型转换 (93)
- python进度条 (67)
- python吧 (67)
- python的for循环 (65)
- python格式化字符串 (61)
- python静态方法 (57)
- python列表切片 (59)
- python面向对象编程 (60)
- python 代码加密 (65)
- python串口编程 (77)
- python封装 (57)
- python写入txt (66)
- python读取文件夹下所有文件 (59)
- python操作mysql数据库 (66)
- python获取列表的长度 (64)
- python接口 (63)
- python调用函数 (57)
- python多态 (60)
- python匿名函数 (59)
- python打印九九乘法表 (65)
- python赋值 (62)
- python异常 (69)
- python元祖 (57)
