Python 入门(十)列表生成式
生成列表
要生成list [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],我们可以用range(1, 11):
>>> range(1, 11)
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
但如果要生成[1x1, 2x2, 3x3, ..., 10x10]怎么做?方法一是循环:
>>> L = []
>>> for x in range(1, 11):
... L.append(x * x)
...
>>> L
[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
但是循环太繁琐,而列表生成式则可以用一行语句代替循环生成上面的list:
>>> [x * x for x in range(1, 11)]
[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
这种写法就是Python特有的列表生成式。利用列表生成式,可以以非常简洁的代码生成 list。
写列表生成式时,把要生成的元素 x * x 放到前面,后面跟 for 循环,就可以把list创建出来,十分有用,多写几次,很快就可以熟悉这种语法。
任务
请利用列表生成式生成列表 [1x2, 3x4, 5x6, 7x8, ..., 99x100]
提示:range(1, 100, 2) 可以生成list [1, 3, 5, 7, 9,...]
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAz4AAACoCAIAAACufqxMAAAdRUlEQVR4nO2d3Y9cRXqH+zpRNhcbIXbJMDuwLJB41xjixcJgx2MgZsZmrTXmw8BYwWsrKAmxGGxZtkgyVrC0G4ETbAfs5YIgK5aIHWudlYgys06QYssXK5bsKrf9B3AH/0Dnonu6z+lTVac+3qo6p+f56bmYrj7nrfdUHb/1c53pns7vfeNOAAAAAPDmzm/f9+TTe3btfeHJp3ff9Z27vn77bb/1td+5d/0DJ//x7Q//9V9+/t//8W+/+OSnH//zpZ9f+/SX//OLXy7/+3/957M/OvSte7+zbuMDO/e+sGvvC0/u+uGdd99n01cn+9UCAAAAtJ1v3Hn3H//J/K69L+za+8Kjs9tvv+OO3/7dr92z/v4dzz33l3997C/eXPrTv/rzPzt67O/Pn/vbf3hnx/N77t2wftvcU/3jtz45d/udd1t2hHUDAAAAEOC2b06v//4jcz98rm/Its/t3LRl+3cf+qPvfn/j9H13f/322/7wwe89tPnRbXM7n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n1ZcrxCTk+Uj7e7YYWFCisGwBAUsTKt4WlsGlMY5XMLVi38OMj5YN1a6CwbgAASZGs4Prl3O93jyI9gNM1utoXv2RsXhrOTWPdqvPlerxsPuHthhYUKKwbAEBShIu4cQl3XUfDV1ldPuZMYli3XtleZLduunzGfq7tV3e8VD6WfWHdMgrrBgCQFMkKbrGE2zsPEd+mC+Vh3USW/KH58B4HQetmyKca39sqieRTbce6NUedjz/++LPPPsO6AQCkQax82y3hfoeJ56Nc0cckm49TeuY8YyTWEOuWIB+sm7g6n3/+6ytXrmDdAADSIFa+vZbSqPtbrv36Hewn73GIbZVc5xHrhjq/+c3/nfunc1g3AIA0iJVvi6XU9cHlWBynRVfKuknl09PbC5sWZUpjjSL5WF67TRyp8ZFqNzSiEHU+//zXWDcAgGRIVnD900bdQq60LGMqtovko+xXd0qMfHQ9Vq2PeUjNLX75GNoNvTQ/n+JbTlmhWnV+9av/xboBACQjd9l3UNMWXfIxq1H56EwwChfWDQAgKbnLvpWatuKSj1lNywdFFdYNACApucs+QqjdwroBACQld9lHCLVbWDcAgKTkLvsIoXYL6wYAkJTcZR8h1G5h3QAAkpK77COE2i2sGwBAUnKXfYRQu4V1AwBISu6yjxBqt7BuAABJyV32EULtFtYNACApucs+QqjdwroBACQld9lHCLVbWDcAgKTkLvsIoXYL6wYAkJTcZR8h1G5h3QAAkpK77COE2i2sGwBAUnKXfYRQu4V1AwBISu6yjxBqt/4fCbw/LzNxYF4AAAAASUVORK5CYII=" alt="" />
复杂表达式
使用for循环的迭代不仅可以迭代普通的list,还可以迭代dict。
假设有如下的dict:
d = { 'Adam': 95, 'Lisa': 85, 'Bart': 59 }
完全可以通过一个复杂的列表生成式把它变成一个 HTML 表格:
tds = ['<tr><td>%s</td><td>%s</td></tr>' % (name, score) for name, score in d.iteritems()]
print '<table>'
print '<tr><th>Name</th><th>Score</th><tr>'
print '\n'.join(tds)
print '</table>'
注:字符串可以通过 % 进行格式化,用指定的参数替代%s。字符串的join()方法可以把一个 list 拼接成一个字符串。
把打印出来的结果保存为一个html文件,就可以在浏览器中看到效果了:
<table border="1">
<tr><th>Name</th><th>Score</th><tr>
<tr><td>Lisa</td><td>85</td></tr>
<tr><td>Adam</td><td>95</td></tr>
<tr><td>Bart</td><td>59</td></tr>
</table>
任务
在生成的表格中,对于没有及格的同学,请把分数标记为红色。
提示:红色可以用 <td style="color:red"> 实现。
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAA38AAAEMCAIAAAD7/JieAAAgAElEQVR4nO2d7W8cSWKf+TlBnA82Dmdf5mjeee11IvOcvfBOuDlSFk93c5RWtsE78m4H5Ei2hIUOSURhNRsQHDj0CtAKq5iHhBpC2g1BrAGCARIyhBQLCkJRlwVCgh/8N/BfUT50dXdVd1W/TXXXvDw/PB/IZk91dU9r5lG9dI39zu9+EwAAAAAgmW/+wbs/+fOfXV/44Cd//pff+sNv/fbXv/ZPfuuf/dF3/vTBf9n48n/s/cP//d//8/jVf/3vf//f/uHFV//4/47/8eh//eb/LN7+8Pf/6A8vTP3p+wsfXF/44CfX57/57XfHnJ8JAAAAAAwEv/vNb/9Z49r1hQ+uL3zww9kfff0b3/in//y33vnOH//0F7/49/9x9d/9zSd/tfJv7/yH1f/0+dbf/udf//SXP/ujf/2dy1fnvP0v/eTq17/57d/53W9inwAAAACQla/93vh3vveDq/O/8JzyR1ffvzjzoz/57r/5k+9Njb/77d/++tf+1XuT363/8PLV93/853/p7fP+z37xp9+vf+0b414J2CcAAAAA5OP3xv/g+zOz7/9MOKiJ93/2i+/P/Ogbv/+O/FrsEwAAAACK8PV/8a0//s53L1760eWfXv/pX/z8/Z//8v2f//Knf/Hzyz99//szP/rj73z367WJ+KuwTwAAAACoDuwTAAAAAKoD+wQAAACA6sA+AQAAAKA6sE8AAAAAqA7sEwAAAACqA/sEAAAAgOrAPgEAAACgOrBPAAAAAKgO7BMAAAAAqgP7BAAAAIDqwD4BAAAAoDqwTwAAAACoDuwTAAAAAKoD+wQAAACA6hirjU+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S2Ja06wC75UjSaf01wJtn3qa8y+PzaMzdXYY99R6ezkoYXEjEEfhneJPzfmIPsbLl1sx4y2a9fZyXGEBAACGGNfqRQbKPqW1jpoPZYMMR3aG2z209hmWc3VDHhVqxT4TfU7fb57e8x72kkdKiHbux+xT3SE25FQUbnBlAACA4cO1epHhsE9zL3nl9um1TRrs0zDUUm+f040duUe+mH1GCtF11ot9mOEOAACjgWv1IgNqn1Pt7e7GwvhEre/sc6I2bmxNNLVx6rZPruxJG221fcavDz3vAAAwYrhWLzKY9rlwL5wVZNE+1U783ojPOtL2envHbS/Hmh7rj0J/rT8ytH3qx3Gax31GYNYRAACMIK7Vi1iyz5vPTk/OZIRrmrYXs0/thHSDfar7hy9Jsk/lVT3OeR+f0ExvNz7DKJjDLplicz7sK282dtRZR7EJ8ur2hD/J5dPbDgAAo4dr9SIDs9ZRZNznwJHSAw4AAADV4Fq9CPYJAAAAo4Rr9SLYJwAAAIwSrtWLDIx9AgAAAFjAtXoR7BMAAABGCdfqRbBPAAAAGCVcqxfBPgEAAGCUcK1eBPsEAACAUcK1ehHsEwAAAEYJ1+pFsE8AAAAYJVyrF8E+AQAAYJRwrV4E+wQAAIBRwrV6EewTAAAARgnX6kWwTwAAABglXKsXwT4BAABglHCtXkTY5/8HAJYY8uavvWoAAAAASUVORK5CYII=" alt="" />
条件过滤
列表生成式的 for 循环后面还可以加上 if 判断。例如:
>>> [x * x for x in range(1, 11)]
[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
如果我们只想要偶数的平方,不改动 range()的情况下,可以加上 if 来筛选:
>>> [x * x for x in range(1, 11) if x % 2 == 0]
[4, 16, 36, 64, 100]
有了 if 条件,只有 if 判断为 True 的时候,才把循环的当前元素添加到列表中。
任务
请编写一个函数,它接受一个 list,然后把list中的所有字符串变成大写后返回,非字符串元素将被忽略。
提示:
1. isinstance(x, str) 可以判断变量 x 是否是字符串;
2. 字符串的 upper() 方法可以返回大写的字母。
aaarticlea/png;base64,iVBORw0KGgoA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Tbz/yKQxj0EDQL+AAAAAElFTkSuQmCC" alt="" />
多层表达式
for循环可以嵌套,因此,在列表生成式中,也可以用多层 for 循环来生成列表。
对于字符串 'ABC' 和 '123',可以使用两层循环,生成全排列:
>>> [m + n for m in 'ABC' for n in '123']
['A1', 'A2', 'A3', 'B1', 'B2', 'B3', 'C1', 'C2', 'C3']
翻译成循环代码就像下面这样:
L = []
for m in 'ABC':
for n in '123':
L.append(m + n)
任务
利用 3 层for循环的列表生成式,找出对称的 3 位数。例如,121 就是对称数,因为从右到左倒过来还是 121。
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyQAAAEBCAIAAAAGlvb/AAAgAElEQVR4nO2dX4scV3rG+0PkIgmZDBMSSIJIsIOIsL0WnuyGtbTeCLx2stLuCFaRwDeOkCxhZEwYgwVrWAskGVtCF4sRMQQbs77xxQiBLyR0lw8QmA+gb5CrzkVPd9efc06dc+o971tV/Xv4XUyfPqqn/vl9H1dVd8/+9/n/AQAAAEAhZuZrAAAAADBhCFsAAAAABZn996P/AQAAAIBCzP7oT/4cAAAAAHryp9t/+Y+v7v7szX99461fViFsAQAAAIjxx3/2F3/z9/9w4uQ/vfbTN376L7/42S/+jbAFAAAAUBDCFgAAAEBBCFsAAAAABSFsAQAAABSEsAUAAABQEMIWAAAAQEEIWwAAAAAFIWwBAAAAFISwBQAAAFAQwhYAAABAQQhbAAAAAAUhbAEAAAAUhLAFAAAAUBDCFgAAAEBBCFsAAAAABZk9f/58a3sHpJghhJBHc4TQRoqwRdhCCCnJuuAjhGxE2CJsIYSUZF3wEUI2ImwRthBCSrIu+AghGxG2CFsIISVZF3yEkI0IW4QthJCSrAs+QshGhC3CFkJISdYFHyFkI8IWYQshpCTrgo8QshFhi7CFEFKSdcFHCNmIsEXYQggpybrgI4RsRNgibCGElCRcvostGSEkK8IWYQshpCTh8k3GQmgkImwRthBCShIu354FBsadb0mtWMb6lPMN7PZJ+gbeLecbPsMVzivl/dxnewlbhC2EkJJEekBMMwh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JriEHx9C4lZvtQF1M6Dq+Bru715497lE7YAAHRI7gAxRbzVnJx3fJzzpXxjFl7INzVoivjqhID2cex8KRXvkraotK/PXWF7k8Y7XMYftk6++9HBdx+993KZ4vjqB988efb0ybOnT7698WoZixev/f6dswZ138p36/h7D+4efHf34Lu7Bw/2ThqsQI2y548Sr934utj56WL3/W+/ef+1xH/FcVcJWybhI2bJRX1tQ57aFZdNu7LVZ3xovlJh6/SHf3j65Nnnvxl82Hrrclqhf/WDb558tud669jN/fOHd05fqo9funz+8M75wzvnD/d3f9w1/pNPv3/n7M7W2d++c3bnxWu/v3Ht1R77IWF9BH1/9dnTrz/YTfknZz++e/Dxqf7HXYoJhK2928+e3t5rDLrPBz9p5/PW3t0nz+7+KmElOe47WwXCVuptu4ld1prXQ4+m77wSs8rt58bSYsKWoHukXWnfziWPIm9JhK1///zJs28//M/PjcJWGjJh6/XTh3fevvnr043mdOnyqicdu7l//vDyifD41vbOTz79/pPH33/y+PteSStxfcR8M8LW8fce3P3dW+rHfcI4DoHnfPCSfv5shf4/xAXHfXtnSzpsdfak1GaZ7Zs33t/XdntL+7YXuJlhyzDk5Y27J/cOW6c//MPnvzmKXD3D1sl3Pzr4+NTZj4/uNTx89/jRWy/vPXywd/LlvYeNexCrke8un+1cznryitq/cuPqKMdu7p++tL1oUdXmdOLhnbdvLtd56/juD0cvfeM7W9s7L177fTP07N198tmN9799+uTZ09t7e7efPX3yrHbL5iefNhJS6vp4fLd33/925dg0bfuub7CuiGm97qZ78t2PVsdl/a7vuLvp2m9tks6fAC9c/OrKxZMvXPxq/8vH+18+vnJxvZ67Nx4vBve/vLW7XP6btx5fOHPuwtH4V2+eWFu/eWs1//H+l48vnGkt59b1F6rur934unmFyXc++Mg5f7a2d7a292537WGN49513pY77hnkdABf7Y64kBO4AyXrG79Ksr6221vON3DLMmlcyte3WAXf1OMu4ltiP8s9syUUtr5b3mt4ee/h6iL/UXFcvDz+3oN6HXx572G7aNYyVuVduduIreZUfXl894c75w/vn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FsAAEqUquOELYSGLcIWAIASkrVb4nu2Mp7fyn4o3mlE2EIbIsIWAIASkrV7Kd+488GpmEfpe/pGjq/eTXJHaKQibAEAKGFd8B0yiTu+RIjQVEXYAgBQwrrg10TWQUhNhC0AACWsCz5CyEaELQAAJawLPkLIRoQtAAAlrAs+QshGhC0AACWsCz5CyEaELQAAJawLPkLIRoQtAAAlrAs+QshGhC0AACWsCz5CyEaELQAAJawLPkLIRoQtAAAlrAs+QshGhC0AACWsCz5CyEaELQAAJawLPkLIRoQtAAAlrAs+QshGhC0AACWsCz5CyEb/D4GW7B52Tlj+AAAAAElFTkSuQmCC" alt="" />
Python 入门(十)列表生成式的更多相关文章
- python学习笔记——列表生成式与生成器
1.列表生成式(List Comprehensions) python中,列表生成式是用来创建列表的,相较于用循环实现更为简洁.举个例子,生成[1*1, 2*2, ... , 10*10],循环用三行 ...
- Python中的列表生成式和多层表达式
Python中的列表生成式和多层表达式 如何生成[1x1, 2x2, 3x3, ..., 10x10]的列表? L=[]; ,): L.append(x*x) print L print (" ...
- python 迭代 及列表生成式
什么是迭代 在Python中,如果给定一个list或tuple,我们可以通过for循环来遍历这个list或tuple,这种遍历我们成为迭代(Iteration). 在Python中,迭代是通过 for ...
- (python函数02)列表生成式
(python函数02)列表生成式 示例代码 num = [i for i in range(1, 10)] print(num) num = [i for i in range(1, 10) ...
- python基础:列表生成式和生成器
列表生成式(List Comprehension) 列表生成式即List Comprehensions,是Python内置的非常简单却强大的可以用来创建list的生成式. 举个例子,要生成 list ...
- Python自学笔记-列表生成式(来自廖雪峰的官网Python3)
感觉廖雪峰的官网http://www.liaoxuefeng.com/里面的教程不错,所以学习一下,把需要复习的摘抄一下. 以下内容主要为了自己复习用,详细内容请登录廖雪峰的官网查看. 列表生成式 列 ...
- python中的列表生成式
列表生成式即List Comprehensions,是Python内置的非常简单却强大的可以用来创建list的生成式. 举个例子,要生成list [1, 2, 3, 4, 5, 6, 7, 8, 9, ...
- Python高级教程-列表生成式
List Comprehensions(列表生成式) 列表生成式,是Python内置的非常简单却强大的可以用来创建list的生成式. 例如,要生成list:[1,2,3,4,5,6,7,8,9,10] ...
- Python高级特性——列表生成式(list Comprehensions)
List Comprehensions 即列表生成式,是Python内置的强大的用来生成列表list的生成式. 简单菜: >>> l = list(range(2,13)) > ...
- Day9 python高级特性-- 列表生成式 List Comprehensions
Python内置的非常简单却强大的可以用来创建list的生成式. 私理解为,就是for循环出来的结果搞成个list~~~~ 要生成顺序增量list可以使用list(range(x,y))来 ...
随机推荐
- Java Callable并发编程模板
submit方法会产生Future对象,它用Callable返回结果的特定类型进行了参数化,可以用isDone()的方法来查询Future是否已经完成.当任务完成是,它具有一个结果,可以调用get() ...
- Makefile学习之路——2
让你的makefile更专业. 在上一个Makefile所在目录下通过touch命令创建一个clean文件,执行make clean,将发现make总是提示clean文件是最新的,而不是按我们期望的那 ...
- 4款基于jquery的列表图标动画切换特效
网页中列表图标随处可见,特别是移动网页上,基本上的导航都采用了列表图标.今天给大家分享4款基于juqery的列表图标和关闭图标的动画切换特效.喜欢的网友赶紧收藏吧. 在线预览 源码下载 实现的代码 ...
- Linux 含有ext 分区的镜像无法再Windows上拷贝的解决办法
首先,参考http://www.cnblogs.com/chenfulin5/p/6649801.html 通过上面这个链接,做一个镜像出来. // 1. 制作一个镜像文件,里面包含200M左右的空间 ...
- 一站式学习Wireshark(九):应用Wireshark显示过滤器分析特定数据流(上)
介绍 掌握显示过滤器对于网络分析者来说是一项必备的技能.这是一项大海捞针的技巧.学会构建,编辑,保存关键的显示过滤器能够节省数小时的时间. 与捕捉过滤器使用的BPF语法不同,显示过滤器使用的是Wire ...
- 运行带distance field的Hiero
从http://libgdx.badlogicgames.com/releases/下载zip包并解压,切换到解压后的目录,执行: java -cp gdx.jar;gdx-natives.jar;g ...
- 简单十招提高jQuery执行效率
1. 使用最新版本的jQuery jQuery的版本更新很快,你应该总是使用最新的版本.因为新版本会改进性能,还有很多新功能. 下面就来看看,不同版本的jQuery性能差异有多大.这里是三条最常见的j ...
- Spring 4 官方文档学习(十一)Web MVC 框架之resolving views 解析视图
接前面的Spring 4 官方文档学习(十一)Web MVC 框架,那篇太长,故另起一篇. 针对web应用的所有的MVC框架,都会提供一种呈现views的方式.Spring提供了view resolv ...
- 10个最佳的触控手式的JavaScript框架(转)
由于各种原因移动开发是一项艰难的工作,比如它是非常耗时的.充满压力的任务.最重要的是,作为一个开发人员,你必须保持更新所有最新 的技术和技巧——你必须知道所有最新的趋势,问题和解决方案等.例如跨浏览器 ...
- Android camera 竖直拍照 获取竖直方向照片
竖直拍照 if (Integer.parseInt(Build.VERSION.SDK) >= 8) { camera.setDisplayOrientation(90); } else ...