Monday, October 19, 2015

Lab 6 - Find student BMI

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 = [58, 62 ,60 ,72 ,55 ,55 ,50]
    height = [169, 170 ,172 ,188 ,165 ,158 ,160]
    print("--- Student student BMI ---")
    print("")
    cal_bmi(name,height,weight)

def cal_bmi(name,height,weight):
    i=0
    while(i < len(weight)):
        bmi=weight[i]/((height[i]/100)*(height[i]/100))
        print("Name ",name[i])
        print("Your Weight is" ,weight[i])
        print("Your Height is" ,height[i])
        print("Your BMI is" ,bmi)
        print("")
        i+=1

setup()

No comments:

Post a Comment