วันศุกร์ที่ 2 ตุลาคม พ.ศ. 2558

[LAB5] my_strip()

def my_strip():
   my_strip = 'Thailand   '
   current = '        '
   my_newstrip = ''
   count = 0
   while(count < len(my_strip)):
      if(count < len(current)):
         my_newstrip = my_newstrip + my_strip[count]
      count = count + 1
   return my_newstrip
 
print(my_strip())

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

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