2.8(中)下列数据类型打印正确的是? print( [ ] ) print( ) print( { } ) print( set() )
举一反三
- 有字典weather如下,下列选项中可以打印“阴”的是( )weather = {"周一": [26, "晴"], "周二": [24, "阴"], "周三": [22, "雨"]} A: print(weather["周一"][0]) B: print(weather["周一"][1]) C: print(weather["周二"][1]) D: print(weather["周二"][2])
- 代码 a = [ 1,2,3,4,5 ],以下输出结果正确的是? A: print(a[:]) => [1,2,3,4] B: print(a[0:]) => [2,3,4,5] C: print(a[:100]) => [1,2,3,4,5] D: print(a[-1:]) => [1,2]
- Python语句print(set([1,2,1,2,3]))的输出结果是()。
- 写出并理解下列语句输出的结果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:])
- 代码a=[1,2,3,4,5],以下输出结果正确的是( )。 A: print(a[:])=>[1,2,3,4] B: print(a[0:])=>[2,3,4,5] C: print(a[:100])=>[1,2,3,4,5] D: print(a[-1:])=>[1,2]