题目
在Python中,以下哪个选项是正确的单行注释方式 A. / *This is a comment* /B. / /This is a commentC. < !- -This is a comment- - >D. #This is a comment
在Python中,以下哪个选项是正确的单行注释方式
- A. / *This is a comment* /
- B. / /This is a comment
- C. < !- -This is a comment- - >
- D. #This is a comment
题目解答
答案
D
解析
在Python中,单行注释的正确方式是使用`#`符号。`#`符号后面的内容将被视为注释,不会被Python解释器执行。其他选项如`/*...*/`、`//...`和``是其他编程语言或标记语言中使用的注释方式,不适用于Python。