class student:
def __init__(self,names,idno,ages,we ,he ):
self.names = names
self.idNo = idno
self.age = ages
self.weight = we
self.height = he
def display(self):
print('Name :',self.names,' ID NO.:',self.idNo,' Age :',self.age,' Weight :',self.weight,' Height :',self.height)
def setup():
j1=student('James',58001,13,177,50)
j2=student('Jane',58002,15,140,60)
j3=student('John',58003,17,156,54)
j4=student('Jonas',58004,20,188,70)
a=[j1,j2,j3,j4]
i=0
while(i<len(a)):
a[i].display()
i=i+1
setup()
ไม่มีความคิดเห็น:
แสดงความคิดเห็น