Teaching
1. Frequent mistakes
- WK1
- not putting
:
(colon) after for loop - no indentation
- misspelling
range
- not putting
- Other weeks
- not putting
:
(colon) after if/while loop - using
else
withwhile
- IndentationError
- not putting
2. Frequent tips
- WK1
- use
_
instead ofi
- group indent by tabbing the block
- write the rest of the function name automatically by pressing tab
- delete repeating parts and fill for loop instead
- copy-reuse the first four lines loading library (
cs1robots
) and world data (load_world
,create_world
, etc.)
- use
- Other weeks
- copy the code from other task and modify a very little bit
print
statement to debugctrl + /
to comment out a linewhile True
andbreak
tab
andshift + tab
to indent and unindent- Block indent by scrolling through multiple lines
ctrl + h
to replace
3. Easy refactoring
-
repetition -> for loop
for i in range(5): # Your code here (repeated action)
-
repetition -> function
def my_function(): # Your code here (repeated action)
-
action
ABABA
-> halt in the middle of the last loop offor
for i in range(3): # Your code here (repeated action) if i == 2: break # Rest of the code
Learning
- How to teach
- How to explain the concept
- How to give hints
- How to give feedback
- How to motivate
- How to be calm