pass語句是個空操作;在執行時沒有任何反應。 pass 在程式碼中最終會很有用,但程式碼還尚未具體編寫。
pass
#!/usr/bin/python3 for letter in 'Python': if letter == 'h': pass print ('This is pass block') print ('Current Letter :', letter) print ("Good bye!")
Current Letter : P Current Letter : y Current Letter : t This is pass block Current Letter : h Current Letter : o Current Letter : n Good bye!