+ ordinal + '\t' + year)'''运行结果:['st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', '...th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'th', 'st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th',...省略左边的索引表示从开头开始截取,省略右边的索引表示截取到末尾。...但是创建一个只有一个元素的元组则必须要有逗号 (42) == 42 #有逗号的才表示是一个元组 (42,)3 * (40+2) 1263 * (40+2, ) (42, 42, 42)为什么使用元组可以用作映射里的...= 'python ' >>>favorite\_language.rstrip() 'python' >>> favorite\_language 'python ' #lstrip()是去除开头的空白