程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Illustration of Python | continue statement

編輯:Python
ShowMeAI research center

author : Han Xinzi @ShowMeAI

Tutorial address :http://www.showmeai.tech/tutorials/56

This paper addresses :http://www.showmeai.tech/article-detail/74

Statement : copyright , For reprint, please contact the platform and the author and indicate the source

Python-continue sentence

Python continue A statement is used to tell Python Skip the rest of the current loop , Then proceed to the next cycle ( and break Is to jump out of the cycle ).

continue Statement used in while and for In circulation .

Python Language continue The syntax of the statement is as follows :

continue

flow chart :

continue Statement execution flow

Here's a code example ( The code can be in On-line python3 Environmental Science Run in ):

for letter in 'ItIsShowMeAI': # First instance
if letter == 'h':
continue
print(' The current letter :', letter)
var = 10 # Second example
while var > 0:
var = var -1
if var == 5:
continue
print(' Current variable value :', var)
print(" complete !")

The execution result of the above example :

 The current letter : I
The current letter : t
The current letter : I
The current letter : s
The current letter : S
The current letter : o
The current letter : w
The current letter : M
The current letter : e
The current letter : A
The current letter : I
Current variable value : 9
Current variable value : 8
Current variable value : 7
Current variable value : 6
Current variable value : 4
Current variable value : 3
Current variable value : 2
Current variable value : 1
Current variable value : 0
complete !

Data and code download

The code for this tutorial series can be found in ShowMeAI Corresponding github Download , Can be local python Environment is running , Babies who can visit foreign websites can also directly use google colab One click operation and interactive operation learning Oh !

This tutorial series covers Python The quick look-up table can be downloaded and obtained at the following address :

  • Python Quick reference table

Expand references

  • Python course —Python3 file
  • Python course - Liao Xuefeng's official website

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved