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コード
削除
自動保存:
を復元しますか?