Intro to Computer Science 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.
2
Q
What generates a NameError in Python?
A
Attempting to use a variable that hasn’t been created.
3
Q
What generates a SyntaxError in Python?
A
Attempting to use an operator with no value to its left and right.
4
Q
What are two ways to split a line in two when it gets too long?
A
- Make sure the line break occurs inside a parenthesis.
2. Use a line-continuation character, which is a \