comments Flashcards

1
Q

A remark inserted into the program, which is omitted at runtime

A

comment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

In Python, a comment is a piece of text that begins with

A

a # (hash) sign and extends to the end of the line.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

If you want a comment that spans several lines, you have to put a hash in front of them all.

A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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.

A

good, responsible developers describe each important piece of code,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

to comment and uncomment several lines of code use

A

CTRL + / (WINDOWS)

CMD + / MAC

How well did you know this?
1
Not at all
2
3
4
5
Perfectly