程序段如下:import jsondt = {'b':2,'c':4,'a':6}s1 = json.dumps(dt)print(s1)print函数输出的结果是( )
A: {"a":6,"b":2,"c":4}
B: {"a":6,"b":2,"c":4}
C: {2, 4, 6}
D: {"b","c" ,"a"}
A: {"a":6,"b":2,"c":4}
B: {"a":6,"b":2,"c":4}
C: {2, 4, 6}
D: {"b","c" ,"a"}
举一反三
- 程序段如下:import jsondt = {'b':2,'c':4,'a':6}s1 = json.dumps(dt)s2 = json.dumps(dt,sort_keys=True,indent=4)print(s1==s2)print函数输出的结果是( ) A: false B: False C: True D: true
- 下面代码的输出结果是( )。 s=[4,3,6,2] t=sorted(s) print(s) print(t) A: [4, 3, 6, 2] [2, 3, 4, 6] B: [2, 3, 4, 6] [2, 3, 4, 6] C: [4, 3, 6, 2] [4, 3, 6, 2] D: [2, 3, 4, 6] [4, 3, 6, 2]
- 程序段如下:import jsondt = {'b':2,'c':4,'a':6}s2 = json.dumps(dt,sort_keys=True,indent=4)print(type(s2))print函数输出的结果是( ) A: <class 'dict'> B: <class 'str'> C: <class 'tuple'> D: <class 'list'>
- 程序段如下:import jsondt = {'b':2,'c':4,'a':6}s2 = json.dumps(dt,sort_keys=True,indent=4)dt1 = json.loads(s2)print(type(dt1))print函数输出的结果是( ) A: <class 'list'> B: <class 'dict'> C: <class 'tuple'> D: <class 'str'>
- 以下程序的输出结果是( )def fun1(a,b,*c):print(a,b,c)fun1(1,2,3,4,5,6) A: 1 2 {3, 4, 5, 6} B: 1,2,3,4,5,6 C: 1 2 (3, 4, 5, 6) D: 1 2 [3, 4, 5, 6]