1) What is a dictionary in Python? a) A collection of ordered pairs of keys and values b) A type of list c) A collection of functions d) A list of strings 2) How do you define a dictionary in Python? a) d = {} b) d = [] c) d = () d) d = dict() 3) What function is used to add a key-value pair to a dictionary in Python? a) A) append() b) B) insert() c) C) update() d) D) add() 4) Which of the following is a correct way to access the value of a specific key in a Python dictionary? a) A) dict[<key>] b) B) dict.get(<key>) c) C) dict.<key>() d) D) Both A and B 5) Which method is used to get a list of all the values in a Python dictionary? a) A) values() b) B) keys() c) C) items() d) D) lists() 6) What method would you use to retrieve a value for a specific key from a Python dictionary? a) A) get() b) B) find() c) C) extract() d) D) fetch() 7) What will the following code output? a) A) None b) B) 0 c) C) "Not Found" d) D) KeyError 8) Which method would you use to remove a key-value pair from a dictionary in Python? a) A) del b) B) remove() c) C) pop() d) D) Both A and C 9) How can you check if a key exists in a Python dictionary? a) A) key in dictionary b) B) dictionary.has_key(key) c) C) key.exists() d) D) dictionary.check_key(key) 10) What does the keys() method return when called on a dictionary? a) A) A list of values b) B) A list of keys c) C) A dictionary d) D) A tuple of key-value pairs
0%
DICTIONARY
共有
共有
共有
Stuti023229
さんの投稿です
Class 11
python
コンテンツの編集
印刷
埋め込み
もっと見る
割り当て
リーダーボード
もっと表示する
表示を少なくする
このリーダーボードは現在非公開です。公開するには
共有
をクリックしてください。
このリーダーボードは、リソースの所有者によって無効にされています。
このリーダーボードは、あなたのオプションがリソースオーナーと異なるため、無効になっています。
オプションを元に戻す
ゲームショウ・クイズ
は自由形式のテンプレートです。リーダーボード用のスコアは生成されません。
ログインが必要です
表示スタイル
フォント
サブスクリプションが必要です
オプション
テンプレートを切り替える
すべてを表示
アクティビティを再生すると、より多くのフォーマットが表示されます。
オープン結果
リンクをコピー
QRコード
削除
自動保存:
を復元しますか?