2021年春季《Pyho编程技术(省)》02任务
1.[单选题] 下面代码的输出结果是a = "ac" b = "bd" c = a + b print(c)
A.dbac
B.abcd
C.acbd
D.bdac
答:——C——
2.[单选题] 下面代码的输出结果是>>> bin(10)
A.'0o1010'
B.'0d1010'
C.'0b1010'
D.'0x1010'
答:——C——
3.[单选题] 下面代码的输出结果是 s1 = "The python language is a scripting language." s1.replace('scripting','general') print(s1)
A.The python language is a scripting language.
B.系统报错
C.['The', 'python', 'language', 'is', 'a', 'scripting', 'language.']
D.The python language is a general language.
答:——A——
4.[单选题] 下面代码的输出结果是str1 = "mysqlsqlserverPostgresQL" str2 = "sql" ncount = str1.count(str2,10) print(ncount)
A.0
B.3
C.4
D.2
答:————
5.[单选题] 下面代码的输出结果是a = 5/3+5//3 print(a)
A.5.4
B.2.66666666666666
C.3.333333
D.14
答:————
6.[单选题] 下面代码的输出结果是>>> a = b = c =123 >>> print(a,b,c)
A.0 0 123
B.出错
C.1 1 123
D.123 123 123
答:————
7.[单选题] 给出如下代码 以下选项中描述正确的是for i in range(6): print(chr(ord(9801)+i),end="")
A.chr ("a")返回"a"字符对应的Unicode编码
B.系统报错
C.输出结果为
D.ord(x)函数返回x的Unicode编码对应的字符
答:————
8.[单选题] 下面代码的输出结果是>>> a,b,c,d,e,f = 'Python' >>> b
A.1
B.出错
C.‘y’
D.0
答:————
9.[单选题] 下面代码的输出结果是>>> True / False
A.True
B.1
C.出错
D.FALSE
答:————
10.[单选题] 下面代码的输出结果是str1 = "mysqlsqlserverPostgresQL" str2 = "sql" ncount = str1.count(str2) print(ncount)
A.2
B.5
C.4
D.3
答:————
11.[单选题] 下面代码的输出结果是x=3.1415926 print(round(x,2) ,round(x))
A.2 2
B.6.28 3
C.3.14 3
D.3 3.14
答:————
12.[单选题] 以下选项中,输出结果为False的是
A.>>> 5 is 5
B.>>> False !=0
C.>>> 5 is not 4
D.>>> 5 != 4
答:————
13.[单选题] 下面代码的执行结果是a = 123456789 b = "*" print("{0:{2}>{1},}\n{0:{2}^{1},}\n{0:{2}<{1},}".format(a,20,b))
A.*********123,456,789
B.****123,456,789*****<br /> ****123,456,789***** *********123,456,789<br /> 123,456,789********* 123,456,789*********
C.123,456,789*********
D.123,456,789********* 123,456,789*********<br /> *********123,456,789 ****123,456,789*******
答:————
14.[单选题] 下面代码的输出结果是 x=0x1010 print(x)
A.4112
B.520
C.10
D.1024
答:————
15.[单选题] 下面代码的输出结果是x = 1 x *= 3+5**2 print(x)
A.29
B.28
C.13
D.14
答:————
16.[单选题] 下面代码的输出结果是a = 20 b = a | 3 a &= 7 print(b ,end=",") print(a)
A.6.66667,4
B.4,6.66667
C.4,23
D.23,4
答:————
17.[单选题] 下面代码的输出结果是a = "alex" b = a.capitalize() print(a,end=",") print(b)
A.alex,ALEX
B.ALEX,alex
C.alex,Alex
D.Alex,Alex
答:————
18.[单选题] 下列选项中输出结果是True的是
A.>>> isinstance(255,int)
B.>>> chr(13).isprintable()
C.>>> "Python".islower()
D.>>> chr(10).isnumeric()
答:————
19.[单选题] 下面代码的输出结果是s = "The python language is a cross platform language." print(s.find('language',30))
A.系统报错
B.40
C.11
D.10
答:————
20.[单选题] 下面代码的输出结果是z = 12.34 + 34j print(z.imag)
A.12.12
B.34
C.12
D.12.34
答:————
21.[单选题] 下面代码的输出结果是>>> True / False
A.True
B.-1
C.0
D.系统报错
答:————
22.[单选题] 下面代码的输出结果是 print(pow(2,10))
A.100
B.12
C.1024
D.20
答:————
23.[单选题] 下面代码的输出结果是a = 2 b = 2 c = 2.0 print(a == b, a is b, a is c)
A.True False False
B.True False True
C.False False True
D.True True False
答:————
24.[单选题] 关于Python的分支结构,以下选项中描述错误的是
A.Python中if-elif-else语句描述多分支结构
B.分支结构使用if保留字
C.Python中if-else语句用来形成二分支结构
D.分支结构可以向已经执行过的语句部分跳转
答:————
25.[单选题] 下面代码的输出结果是a ="Python" b = "A Superlanguage" print("{:->10}:{:-<19}".format(a,b))
A.----Python:A Superlanguage----
B.----Python:----A Superlanguage
C.The python language is a multimodel language.
D.Python----:----A Superlanguage
答:———— |