1

So I know when listing variables in object class, you can return every line to list the variables vertically for better organization:

class Thing(object):
  def __init__(x,
               y,
               z):

Is it possible to do the same thing with conditionals in an if statement, like so?

if condition1 and
   condition2 and
   condition3:

Obviously that's probably not the right syntax for it since it doesn't work, but it's a good example of what I'm trying to do in order to organize my code so I don't have scroll to right when something has long names for conditional satements.

Thomas Ahrens
  • 13
  • 1
  • 2
  • 9

1 Answers1

0

Parentheses to the rescue!

if (1 == 1 and
    2 == 2 and
    3 == 3):
   # ...
NPE
  • 486,780
  • 108
  • 951
  • 1,012