1) Object-oriented programming (OOP) describes... a) the properties of different objects b) different classes and objects in a single unit c) a style or model of programming that uses objects. d) a function that uses objects and classes 2) What is the meaning of object in programming ? a) collection of data and methods as two different units. b) collection of data and methods as a single unit. c) classification of data and methods as a single unit. d) classification of data and methods as two different units 3) Choose the wrong description about class. a) a template or “blueprint” for creating an object. b) one class has only one object c) involves in the making of mini battle game d) if class = vegetables, then objects = carrot, brinjal, tomato 4) Syntax for creating a class is... a) Class num = b) class "fruit" : c) class time ; d) class Teacher : 5) If def __init__ (self, name): , the object could be... a) Ali b) Ali, 8 years old c) Kelvin, 23 August 2009 d) Syazwan, Year 8 6) What is a "method" ? a) An array of elements in a same class b) All the objects in a same class c) A variable used to represent an object d) A function that belongs to a class / object 7) When p.walk(0, 7) is executed, the player... a) walk 7 units right b) walk 7 units down c) walk 7 units up d) walk 7 units left 8) Choose the correct statement. a) self can access variables from other class b) self represents the other object in the same class c) self parameter has no argument d) self is passed as a shown parameter 9) enemy.takeDamage(10) means that... a) enemy will absorb 10 HP from the player b) enemy will lose HP by 10 after each damage c) enemy will die when received damage of 10 d) enemy has only 10 HP left for now 10) When enemy is defeated, which code is not written ? a) print("Enemy defeated!") b) if (self.hp <= 0): c) else d) self.hp = 0 11) Choose the correct explanation about "attribute". a) Attribute is actually a variable belongs to a class b) We can only have one attribute in each class c) No value is needed for attribute d) attribute is named before "self" 12) def __init__ (self, name, age): . Which of the following cannot be its value? a) 23 years 6 months and 26 days b) 23 years old c) Jonathan d) 3 November 2017
0%
Coding Quiz (12) : Python OOP
共有
共有
共有
Guanjie0807
さんの投稿です
コンテンツの編集
印刷
埋め込み
もっと見る
割り当て
リーダーボード
もっと表示する
表示を少なくする
このリーダーボードは現在非公開です。公開するには
共有
をクリックしてください。
このリーダーボードは、リソースの所有者によって無効にされています。
このリーダーボードは、あなたのオプションがリソースオーナーと異なるため、無効になっています。
オプションを元に戻す
ゲームショウ・クイズ
は自由形式のテンプレートです。リーダーボード用のスコアは生成されません。
ログインが必要です
表示スタイル
フォント
サブスクリプションが必要です
オプション
テンプレートを切り替える
すべてを表示
アクティビティを再生すると、より多くのフォーマットが表示されます。
オープン結果
リンクをコピー
QRコード
削除
自動保存:
を復元しますか?