Monday, October 19, 2015

Lab 6 - Display student records (data)

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 records (data)---")
    print("")
    display(name, id, age, weight, height)
 
def display(name, id, age, weight, height):
    i=0
    while(i < len(name)):
        print("Name ",name[i])
        print("ID ",id[i])
        print("Age ",age[i])
        print("Weight ",weight[i])
        print("Height ",height[i])
        print("")
        i+=1
 
setup()

No comments:

Post a Comment