comments Flashcards
A remark inserted into the program, which is omitted at runtime
comment
In Python, a comment is a piece of text that begins with
a # (hash) sign and extends to the end of the line.
If you want a comment that spans several lines, you have to put a hash in front of them all.
This program evaluates the hypotenuse c.
# a and b are the lengths of the legs.
a = 3.0
b = 4.0
c = (a ** 2 + b ** 2) ** 0.5 # We use ** instead of square root.
print(“c =”, c)
explaining the role of the variables; although it must be stated that the best way of commenting variables is to name them in an unambiguous manner.
good, responsible developers describe each important piece of code,
to comment and uncomment several lines of code use
CTRL + / (WINDOWS)
CMD + / MAC