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

Lab 5 : Display elements (value) of array and its index

def setup():
   n = [ 1, 8, 7, 12, 3, 6, 9 ]
   i = 0
   while(i < len(n)):
      print("n[",i,"] =", n[i])
      i = i + 1

setup()

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

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