程序如下:try:number = int(input("请输入数字:"))print("number:",number)print("=======hello======")except Exception as e:# 报错错误日志print("打印异常详情信息: ",e)else:print("没有异常")finally:#关闭资源print("finally")print("end")输入的是 1a 结果是:
A. number: 1打印异常详情信息: invalid literal for int() with base 10:finallyend
B. 打印异常详情信息: invalid literal for int() with base 10:finallyend
C. ========hello===========打印异常详情信息: invalid literal for int() with base 10:finallyEnd
D. 以上都正确
查看答案
定义类如下class Hello():def __init__(self,name)self.name=namedef showInfo(self)print(self.name)下面代码能正常执行的ABCD
A. h = Helloh.showInfo()
B. h = Hello()h.showInfo(‘张三’)
C. h = Hello(‘张三’)h.showInfo()
D. h = Hello(‘admin’)showInfo
执行以下代码后的输出结果是哪一个选项?my_list=[s.lower()forsin'Lifeisshort,youneedPython.'.split('')]print('short'inmy_list)print(my_list[5])
A. Falsepython.
B. True python.
C. True Python
D. FalsePython
以下程序的执行结果是哪一个选项?
A. 90
B. 75
C. 87
D. 程序出错
计算numpy中元素个数的方法()
A. np.sqrt()
B. np.identity()
C. np.size()