简体   繁体   中英

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

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")

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")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM