dictdemo = {'1':1,'2':2,'3':3} setnew = {x for x in dictdemo.keys()} print(setnew) 以上代码的运行结果为?
A. {'2', '1'}
B. {'2', '1', '3'}
C. {'2', '3'}
D. {'1', '3'}
set1 = {x for x in range(10)} print(set1) 以上代码的运行结果为?
A. {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
B. {0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10}
C. {1, 2, 3, 4, 5, 6, 7, 8, 9}
D. {1, 2, 3, 4, 5, 6, 7, 8, 9,10}
set1 = {x for x in range(10) if x%2==0} print(set1) 以上代码的运行结果为?
A. {0, 2, 4, 6}
B. {2, 4, 6, 8}
C. {0, 2, 4, 6, 8}
D. {4, 6, 8}
setnew = {i**2 for i in range(3)} print(setnew) 以上代码的运行结果为?
A. {0,1,4}
B. {0,4}
C. {1,4}
D. {4}