Home > Software engineering >  How to write comment behind text in one line if this sentence is divided into many lines?
How to write comment behind text in one line if this sentence is divided into many lines?

Time:04-28

There is a simple example, actually statement is too long to write in one line, and I have to write some necessary comment in each line, but when I add \ and #, it shows error here, how to solve this problem?

   a, b, c = 1,2,3 
    if a > 10 \ #add element a
    or b > 10 \ #add element b
    or c > 10: #add element b
        print("good")

CodePudding user response:

Just put this in bracket.

a, b, c = 1,2,3
if (a > 10 #add element a
or b > 10  #add element b
or c > 10): #add element c
    print("good")
  • Related