python,关键词pass

    xiaoxiao2021-03-25  51

    for letter in 'python': if letter == 'h': pass print " This is pass block" print "Current letter:", letter print " Goodbye" for letter in 'Patrick': if letter == 'r': pass print "This is pass block" print "Current letter:", letter print "Goodbye"

    It is used when a statement is required syntactically but you do not want any command or code to execute. The pass statement is a null operation; nothing happens when it executes. The pass is also useful in places where your code will eventually go, but has not been written yet (e.g., in stubs for example):

    转载请注明原文地址: https://ju.6miu.com/read-33227.html

    最新回复(0)