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

Illustration of Python | pass 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/75

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

Python-pass sentence

Python pass It's an empty statement , To maintain the integrity of the program structure .

pass Not doing anything , Generally used as occupation statement .

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

pass
pass Statement execution flow

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

for letter in 'ItIsShowMeAI':
if letter == 'h':
pass
print(' This is a pass block ')
print(' The current letter :', letter)
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
This is a pass block
The current letter : h
The current letter : o
The current letter : w
The current letter : M
The current letter : e
The current letter : A
The current letter : I
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