Assumptions & Syntax Errors to avoid Flashcards

1
Q

for nxt in adj[cur]:
pass

what’s the assumption and syntax errors to avoid here?

A

key cur must exist in adj dictionary

it will raise syntax error if key cur doesn’t exist

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

What are things to pay attention to when calling variables and methods?

A
  1. make sure the names are right
  2. pay attention to ending s
  3. pay attention to capitalize letters, underscores, etc

write given parameters, method names on paper

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