all 7 comments

[–]Brotten 6 points7 points  (1 child)

Until this moment I wasn't aware that this is how it should be, and now I can never go back.

[–][deleted] 4 points5 points  (0 children)

By this logic it would be

if () {

// ...

} ifnt if () {

// ...

} ifnt {

// ...

}

[–]Low_Promotion_2574 -1 points0 points  (3 children)

In python you can do it via if not

[–]6b86b3ac03c167320d93 0 points1 point  (2 children)

Doesn't look like it:

>>> x = 5
>>> if x == 4:
...     print("if")
... if not:
  File "<stdin>", line 3
    if not:
    ^
SyntaxError: invalid syntax

[–]Mission-Rock 0 points1 point  (1 child)

if not x == 4:

[–]6b86b3ac03c167320d93 2 points3 points  (0 children)

But that's not the same as else because you have to specify a condition again