[Python] Why does python keep evaluating code after `pass`?

Discussão em 'Python' iniciado por Stack, Dezembro 17, 2024.

  1. Stack

    Stack Membro Participativo

    I found an interesting piece of code in python:

    def x(cond):
    if cond:
    pass
    print('Still running!')

    x(True)


    I would expect this not to print anything, but it prints Still running!. What is happening here?

    Continue reading...

Compartilhe esta Página