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 代碼
刪除
恢復自動保存:
?