题目内容

表达式 {1, 2, 3} ^ {3, 4, 5} 的值为( )。

A. {1, 2,3}
B. {1, 2,3,4,5}
C. {1,2, 4, 5}
D. {4, 5}

查看答案
更多问题

已知字符串 x = 'hello world',那么执行语句 x.replace('hello', 'hi') 之后,x的值为( )。

A. 'hello world'
B. hello world
C. 'hi world'
D. hi world

可以使用for循环遍历字典中的元素,默认情况下是遍历字典的“键”,如果需要遍历字典的元素必须使用字典对象的items()方法明确说明。

A. 对
B. 错

使用集合的add()方法增加元素时,如果元素已存在,会自动忽略该操作。

A. 对
B. 错

阅读下面的代码,解释其功能。g=(i**2 for i in range(10))for item in g:if item>50:breakprint(item)

答案查题题库