题型:单选题
运行下列程序,输出的结果是?( )
lis1=["a","e","i","o","u"] strword='hello world' lis2=[] for i in strword: if i not in lis1: lis2.append(i) print(lis2)
| A. ['h', 'l', 'l', ' ', 'w', 'r', 'l', 'd'] |
B. ['h', 'l', 'l', 'w', 'r', 'l', 'd'] |
| C. ['e', 'o', 'o'] |
D. ['e', '', 'o', ' ', 'o'] |
更新时间:2022-11-02 10:33:47
|
【知识点】
电子学会Python二级
抱歉! 您未登录, 不能查看答案和解析点击登录
相似题推荐
单选题
已知列表s = ["a","b","c"],想要在列表开头插入元素 "z",正确语句是?( )
| A. s.insert (0,"z") |
B. s.insert (1,"z") |
| C. s.insert (2,"z") |
D. s.insert (3,"z") |
2026-07-25
单选题
林辰有一个存储歌曲名的列表song。最近他用听歌识曲识别到一首新歌《快乐小马》,想将其添加到列表末尾,下列哪个语句可以实现?( )
| A. song.insert('《快乐小马》') |
B. song.append('《快乐小马》') |
| C. song.insert(《快乐小马》) |
D. song.append(《快乐小马》) |
2026-07-25
