1) Which expression evaluates to 4? a) 7/2*3 b) 7%2+3 c) 7//2-3 d) 7-2*3 2) In which of the following cases we will get <class 'int'> as output? a) x=47.0 print(type(x)) b) x=2**2**2 print(type(x)) c) x=10+20j print(type(x)) d) x='47' print(type(x)) 3) The XYZ Company has hired you as an intern on the coding team that creates an e-commerce application. You must write a script that asks the user for a value. The value must be used as a whole number in a calculation, even if the user enters a decimal value. Which of the following meets this requirement? a) total_items=float(input('How many items you required?')) b) total_items=str(input('How many items you required?')) c) total_items=int(float(input('How many items you required?'))) d) total_items=input('How many items you required?') 4) Which of the following statements are valid? a) The following expression evaluates to 12 b=False+5-True+35//4 b) The following line will print result:4.5 print('result:',(7/2)+(False or True)+(9%3)) c) result=456+456.0 type of result is int d) s="Siri's voice recognition is Good" It causes an error because we cannot use double quotes and single quotes simultaneously 5) Which expression would evaluate to 2? a) 11/2 b) 3**2 c) 22%5 d) 13//4 6) From the sys module, by using which variable we can access command-line arguments? a) argsv b) argv c) arguments d) args 7) Consider the following code:print(type(eval(input('Enter some value:'))))if we enter 10 and 10.0 individually for every run what is the output? a) ? b) ?? c) ??? 8) Which type of exception will be raised if we are trying to call a method on the inappropriate object? a) IndexError b) TypeError c) AttributeError d) None of these 9) Which of the following are True? a) A try block can have any number of except blocks b) A try block can have any number of except blocks. c) A try block should be associated with atmost one finally block d) All the above 10) The base class for all exceptions in python is: a) ExceptionBase b) BaseException c) Exception d) EOFError
0%
Python (37)
共享
共享
共享
由
Lyaisan14
编辑内容
打印
嵌入
更多
作业
排行榜
显示更多
显示更少
此排行榜当前是私人享有。单击
,共享
使其公开。
资源所有者已禁用此排行榜。
此排行榜被禁用,因为您的选择与资源所有者不同。
还原选项
随堂测验
是一个开放式模板。它不会为排行榜生成分数。
需要登录
视觉风格
字体
需要订阅
选项
切换模板
显示所有
播放活动时将显示更多格式。
打开成绩
复制链接
QR 代码
删除
恢复自动保存:
?