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

[LAB5] my_count()

def my_count():
   my_count = "Thailand"
   count = 0
   unit = count
   while(count < len(my_count)):
      if(my_count[count] == "a"):
         unit = unit + 1
      count = count + 1
   return unit

print(my_count())

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

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