Home > Backend Development > Python Tutorial > Python pass statement

Python pass statement

高洛峰
Release: 2016-11-23 10:43:24
Original
1086 people have browsed it

Python pass is an empty statement to maintain the integrity of the program structure.

The Python language pass statement syntax is as follows:

pass

Example:

#!/usr/bin/python
 
for letter in 'Python': 
   if letter == 'h':
      pass
      print 'This is pass block'
   print 'Current Letter :', letter
 
print "Good bye!"
Copy after login

The above example execution result:

Current Letter : P

Current Letter : y

Current Letter : t

This is pass block

Current Letter : h

Current Letter : o

Current Letter : n

Good bye!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template