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