欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Python中的pass語句使用方法講解

 更新時間:2015年05月14日 16:08:29   投稿:goldensun  
這篇文章主要介紹了Python中的pass語句使用方法講解,是Python入門學習中的基礎知識,需要的朋友可以參考下

 Python pass語句使用當語句要求不希望任何命令或代碼來執(zhí)行。

pass語句是一個空(null)操作;在執(zhí)行時沒有任何反應。pass也是代碼最終會是有用的,但暫時不用寫出來(例如,在存根為例):
語法

Python pass語句語法如下:

pass

例子

#!/usr/bin/python

for letter in 'Python': 
  if letter == 'h':
   pass
   print 'This is pass block'
  print 'Current Letter :', letter

print "Good bye!"

當執(zhí)行上面的代碼,它會產生以下結果:

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

相關文章

最新評論