วันเสาร์ที่ 24 ตุลาคม พ.ศ. 2558

lab 6 count age

def setup():
    student_number = [1,2,3,4,5,6]
    age = [35,19,18,20,19,31]
    high = [177,182,170,169,185,160]
    weight = [65,50,60,75,80,55]
    data = [student_number,age,high,weight]
    print(find_the_age(age),'students have age under 30 years old')
def find_the_age(age):
        count = 0
        count_age = 30
        find_age = 0
        while(count<len(age)):
            if(age[count]<count_age):
              find_age +=1
            count = count + 1
        return find_age

   
setup()  

ไม่มีความคิดเห็น:

แสดงความคิดเห็น