第二章测试
1.Which of the following is an invalid variable? ( )
A:_ B:my_string_1 C:foo D:1st_string
答案:D
2.What will be the output of the following Python code ? not(10<20) and not(10>30) ( )
A:False B:No output C:True D:Error
答案:A
3.Which one will return error when accessing the list ‘l’ with 10 elements. ( )
A:l[-1] B:l[0] C:l[10] D:l[-10]
答案:C
4.What will be the output of the following Python code? lst=[3,4,6,1,2]lst[1:2]=[7,8]print(lst) ( )
A:[3, 7, 8, 6, 1, 2] B:Syntax error C:[3,4,6,7,8] D:[3,[7,8],6,1,2]
答案:A
5.Which of the following operations will rightly modify the value of the element? ( )
A: t=('h','e','l','l','o') t[0]='H' B: t={'h','e','l','l','o'} t[0]='H' C: s='hello' s[0]='H' D: t=['h','e','l','l','o'] t[0]='H'
答案:D
6.The following program input data: 95, the output result is?  (    )
A:none of the mentioned B:Please enter your score: 95Awesome!Your ability exceeds 85% of people! C:Please enter your score: 95Awesome! D:Please enter your score: 95Your ability exceeds 85% of people!
答案:B

温馨提示支付 ¥3.00 元后可查看付费内容,请先翻页预览!
点赞(6) dxwkbang
返回
顶部