|
|
|
|
|
by hnfong
1300 days ago
|
|
I'm not sure I understand what's missing in python compared with BASIC. Sure, you can teach students to write `print(" ".join(str(x) for x in range(1, 11)))` to print numbers from 1 to 10... but you don't have to do that. In fact, `X = X + 1` works just fine. The old school BASIC style like `X = 1; while X <= 10: print(X); X = X + 1` still works in python. (sorry for the lack of indentation) What am I missing? (besides the misguided social expectation that you need to teach the fancy generator stuff to a total beginner...) |
|
The teacher would draw the variables as boxes with numbers in them, and update the numbers in the boxes with the eraser and chalk (further revealing my age).
In contrast, Python starts with everything is an object, with properties and methods...
But I agree about the fancy generator stuff. I think you can teach Python in the same fashion by limiting yourself to a few basic (sic) features, and adopt the same virtual machine fiction while remembering that it's a few more layers of abstraction away from reality.