class Student:
def __init__(self,name,id,age,weight,height):
self.name = name
self.id = id
self.age = age
self.weight = weight
self.height = height
def display_name(self):
return self.name
def display_id(self):
return self.id
def display_age(self):
return self.age
def display_weight(self):
return self.weight
def display_height(self):
return self.height
def setup():
a = Student( "Antony" , 11 , 22 , 58 , 165 )
b = Student( "Mike" , 12 , 23 , 66 , 171 )
c = Student( "Jacky" , 23 , 21 , 48 , 162 )
d = Student( "Bank" , 30 , 22 , 57 , 177 )
e = Student( "Billy" , 1 , 20 , 62 , 180 )
f = Student( "Biccy" , 3 , 24 , 62 , 181 )
data = [a,b,c,d,e,f]
find_minimum(data)
def find_minimum(data):
i=0
while(i < len(data)):
if(50 > data[i].display_weight()):
print("Name : ",data[i].display_name())
print("ID : ",data[i].display_id())
print("Age : ",data[i].display_age())
print("Weight : ",data[i].display_weight())
print("Height : ",data[i].display_height())
i+=1
setup()
No comments:
Post a Comment