• What is the pass statement in Python?

    Answered

    What is the pass statement in Python?

    Silver Member Asked on June 4, 2018 in Python.
    Add Comment
  • 1 Answer(s)
    Best answer

    There may be times in our code when we haven’t decided what to do yet, but we must type something for it to be syntactically correct. In such a case, we use the pass statement.

    
    def func(*args):
    
    pass
    
    

    Similarly, the break statement breaks out of a loop

    
    for i in range(7):
    
    if i==3: break
    
    print(i)
    
    

    Finally, the continue statement skips to the next iteration.

    
    for i in range(7):
    
    if i==3: continue
    
    print(i)
    
    
    Silver Member Answered on June 4, 2018.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.