S
S
S_Paw2021-06-16 17:20:03
Python
S_Paw, 2021-06-16 17:20:03

Conditional constructions from NOT?

Good afternoon!
I'm just learning, so sorry for the possibly stupid question.
Studying the code of one project, I noticed that one of the developers builds conditional constructions of the form:

def somecode():
    Если НЕ:
        dosomething()

That is, always an excluding condition at the beginning, and this is real in 100% of cases.
Is it some kind of paradigm or a way of constructing when, or just the taste of a particular person?

Zs I can’t ask the author.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Korotenko, 2021-06-16
@firedragon

Most likely, a quick check usually puts the most common condition first, that is, the one that works most often,
but it seems like a matter of taste

V
Vindicar, 2021-06-16
@Vindicar

Maybe a coincidence. There are no special reasons for this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question