2 of 52
Acomment,thisissoyoucanreadyourprogramlater.
Anything after the
isignoredbypython.print“Icouldhavecodelikethies.”
and the comment after is ignored
Youcanalsouseacommentto“disable”orcommentoutapieceofcode:
print “This won’t run.”
print “This will run.”
save to a file named ex2.py
($ is #)
note:
多行注释可以收尾各用三个连续的单引号或者双引号括起来。