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 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 :
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 !
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 :