On a site with the Algorithm plugins a Python example has the button Flowchart: the program is drawn as a flowchart, with Step and the variables. A flowchart opens as a CodeLab example too.
n = int(input("n: "))
s = 0
for i in range(1, n + 1):
if i % 2 == 0:
s += i
print("Sum of the even numbers:", s)
10
Student
- Click Flowchart: the loop and the if become blocks. Step through the diagram beside the code.
- Change the code and open the flowchart again: it follows the code.
Teacher
- Needs tiny_algorithm 2.13 or newer on the site. Lines without a block are listed under the diagram.
- In the Algorithm editor, Run the code of the code panel opens a flowchart as a CodeLab program.