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 代码
删除
恢复自动保存:
?