下面代码的输出结果是。
s=[4,3,6,2]
t=sorted(s)
print(s)
print(t)
s=[4,3,6,2]
t=sorted(s)
print(s)
print(t)
举一反三
- 下面代码的输出结果是( )。 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]
- 下面代码的输出结果是()。t=[1,2,3] s=tuple(t) print(t,s)
- 下面代码的输出结果是( )。 t=[1,2,3] s=tuple(t) print(t,s) A: [1, 2, 3] [1, 2, 3] B: (1, 2, 3) (1, 2, 4) C: [1, 2, 3] (1, 2, 3) D: (1, 2, 6)[1, 2, 3]
- 下面代码的输出结果是。 a = 2.0 b = 1.0 s = 0 for n in range(1,4): s += a / b t = a a = a + b b = t print(round(s,2))
- 【其它】写出并理解下列语句输出的结果 s = "hello" print(s[0]) print(s[4]) print(s[-1]) print(s[0:3]) print(s[0:4:2]) print(s[:]) print(s[:3]) print(s[::-1]) print(s[1:])