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
2
Q
What are things to pay attention to when calling variables and methods?
A
- make sure the names are right
- pay attention to ending s
- pay attention to capitalize letters, underscores, etc
write given parameters, method names on paper