橘子味的心
标题:Python3 Break 语句

Python3 Break 语句

#!/usr/bin/python3

for letter in 'Python':     # First Example
   if letter == 'h':
      break
   print ('Current Letter :', letter)

var = 10                    # Second Example
while var > 0:              
   print ('Current variable value :', var)
   var = var -1
   if var == 5:
      break

print ("Good bye!")

目录

分类