python 经典面试题 基础部分二练习题——迹忆客-ag捕鱼王app官网

python 经典面试题 基础部分二

1.
(单选题)下面的代码会输出什么? ```python #!/usr/bin/python print 'you are doing well' [2:999] ```
  • you are doing well
  • ''
  • index error
  • u are doing well
2.
(单选题)下列哪一项关于python的叙述是错误的?
  • int(144)==144
  • int('144')==144
  • int(144.0)==144
  • 以上都不对
3.
(单选题)min(''hello world'') 的输出是什么?
  • e
  • 一个空格
  • w
  • 以上都不是
4.
(单选题)以下代码的输出结果是什么? ```python #!/usr/bin/python3 print('any'.encode()) ```
  • any
  • yan
  • b’any’
  • x’any’
5.
(单选题)对于以下代码,下列哪一个说法更准确? ```python x = circle() ```
  • 可以将 int 值赋给 x
  • x 包含对 circle 对象的引用。
  • x 实际上包含一个 circle 类型的对象。
  • x 包含一个 int 值。
6.
(单选题)哪个代码用于打开文件以进行二进制写入?
  • w
  • wb
  • r
  • a
7.
(单选题)以下哪一段代码可以显示如下图形? ![python canvas图形 hello](/uploads/210717/i_20210717215320d0bab9.jpeg)
  • canvas.create_text(text=''hello!'')
  • canvas.create_text(30, 40, text=''hello!'' ,filled=''green'')
  • canvas.create_text(text=''hello!'' ,textcolor=''green'')
  • canvas.create_text(30 , 40, text=''hello!'')
8.
(单选题)以下代码的输出是什么? ```python print(type(1/2)) ```
  • nameerror: '½' 未定义。
  • 0.5
9.
(单选题)以下代码输出结果是什么? ```python #!/usr/bin/python kvps = {'1':1,'2':2} thecopy = kvps kvps['1'] = 5 sum = kvps['1'] thecopy['1'] print(sum) ```
  • 1
  • 2
  • 7
  • 10
10.
(单选题)已知x=43,ch='a',y = 1,则表达式(x>=y and ch <'b' and y)的值是多少?
  • 1
  • 出错
  • true
11.
(多选题)下列python语句正确的是
  • min = x if x < y else y
  • max = x > y ? x : y
  • if(x>y) print(x)
  • while true:pass
扫码一下
查看教程更方便
网站地图