Sunday, October 25, 2015

Lab6 - Find minimum weight of students

def setup():
    name = ["Ant", "Bird" ,"Cat" ,"Dog" ,"Elephant" ,"Frog" ,"Giraffe"]
    id = [19, 23 ,10 ,13 ,22 ,25 ,17]
    age = [18 ,17 ,16 ,19 ,18 ,18 ,17]
    weight = [69, 76 ,60 ,80 ,55 ,55 ,49]
    height = [165, 170 ,172 ,188 ,166 ,158 ,160]
    print("---Student records (data)---")
    print("")
    find_weight(name,id,age,weight,height)

def find_weight(name,id,age,weight,height):
    i=0
    ref=weight[0]
    while(i < len(weight)):
        if(ref > weight[i]):
            ref = weight[i]
        i+=1
    print("Minimum weight of students : ",ref)
    
setup()

No comments:

Post a Comment