简体   繁体   English

如果这句话分成很多行,如何在一行中写文本后面的评论?

[英]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?有一个简单的例子,其实statement太长了写在一行中,我不得不在每一行中写一些必要的注释,但是当我添加\#时,这里显示错误,如何解决这个问题?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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