Intro to Computer Science Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is an augmented assignment and why is it used?

A

An augmented assignment combines an assignment statement with an operator to make the statement more concise.

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

What generates a NameError in Python?

A

Attempting to use a variable that hasn’t been created.

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

What generates a SyntaxError in Python?

A

Attempting to use an operator with no value to its left and right.

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

What are two ways to split a line in two when it gets too long?

A
  1. Make sure the line break occurs inside a parenthesis.

2. Use a line-continuation character, which is a \

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