วันอาทิตย์ที่ 25 ตุลาคม พ.ศ. 2558

Display student records with weight < 50

def setup():
   name = ["AA", "BB", "CC"]
   ID = [54321, 12345, 51234]
   age = [15, 25, 35]
   weight = [70, 45, 60]
   height = [1.60, 1.75, 1.50]
   dis(name, weight)
 
def dis(n, w):
   i = 0
   while(i < len(w)):
      if(w[i] < 50):
         print(n[i], "weight =", w[i])
      i = i + 1

setup()

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

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