Python pass statement

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

pass does nothing, and is generally used as a placeholder statement.

The syntax format of the pass statement in Python language is as follows:

pass

Test case:

Example:

#! /usr/bin/python
# - *- coding: UTF-8-*- 
 
# Output every letter of Python
for letter in'Python':if letter =='h':
  pass
  print 'This is the pass block'
 print 'Current letter:', letter
 
print "Good bye!"

Execution results of the above examples:

Current letter: P
Current letter: y
Current letter: t
This is the pass block
Current letter: h
Current letter: o
Current letter: n
Good bye!

Recommended Posts

Python pass statement
05. Python entry value loop statement
Python multithreading
Python CookBook
Python FAQ
Why doesn't Python support the switch statement?
Python3 dictionary
Python3 module
python (you-get)
Python string
Python basics
Python descriptor
Python basics 2
Python exec
Python notes
Python3 tuple
CentOS + Python3.6+
Python advanced (1)
Python decorator
Python IO
Python multithreading
How to write try statement in python
Python toolchain
Python3 list
Python multitasking-coroutine
Python overview
python introduction
Python analytic
Python basics
07. Python3 functions
Why doesn't Python support the switch statement?
Python functions
python sys.stdout
python operator
Python entry-3
Centos 7.5 python3.6
Python string
python queue Queue
Why doesn't Python support the switch statement?
Python basics 4
Python basics 5