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

lab 6 display number of student that have weight less than 50

def setup():
    weight = [95,50,90,75,60,48]
    print(find_weight(weight),'students have weight less than 50 kg.')
def find_weight(weight):
    count = 0
    find_weight = 50
    count_weight = 0
    while(count<len(weight)):
        if(weight[count]<find_weight):
          count_weight +=1
        count = count + 1
    return count_weight
setup()        

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

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