PFP191_-_SU_2024_-_FE_2357.webp
T

PFP191_-_SU_2024_-_FE_2357.webp

Kizspy | Question: 8
(Choose 1 answer)
Given a code,
class People():
def __init__(self, name):self.name = name
def namePrint(self):print(self.name)
person1 = People("Sally")person2 = People("Louise")
person1.namePrint()
What is correct answer?
A. person1 and person2 are two different instances of the People class.
B. The_init_ method is used to set initial values for attributes.
C. 'self' is not needed in def namePrint(self):
D. person2 has a different value for 'name' than person1.

Thông tin

Category
PFP191
Thêm bởi
thanhphu2003
Ngày thêm
Lượt xem
1,332
Lượt bình luận
5
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom