Python 루프 문


  번역 결과:

프로그래밍 언어는 더욱 복잡한 실행 경로를 허용하는 다양한 제어 구조를 제공합니다. 루프 문을 사용하면 문이나 문 그룹을 여러 번 실행할 수 있습니다

Python 루프 문통사론

Python은 for 루프와 while 루프를 제공합니다(Python에는 do..while 루프가 없습니다)

Python 루프 문예

while循环语句
#!/usr/bin/python
 count = 0while (count < 9):   print 'The count is:', count
   count = count + 1
 print "Good bye!"
for 循环语句
#!/usr/bin/python# -*- coding: UTF-8 -*-
 for letter in 'Python':     # 第一个实例
   print '当前字母 :', letter
 fruits = ['banana', 'apple',  'mango']for fruit in fruits:        # 第二个实例
   print '当前水果 :', fruit
 print "Good bye!"

인기 추천

비디오

Q&A