bterwijn

joined 2 months ago
[–] bterwijn@programming.dev 2 points 1 week ago

Nice one, see the "Solution" link for correct answer.

[–] bterwijn@programming.dev 3 points 1 week ago

Yes I understand your point, but I'm trying to reach out so people are aware and can use it in Python education. I feel it can really help beginners understand tricky concepts with ease, bit it's hard to reach a bigger audience these days. Sorry for the repetition, I'll guess I should cut back a bit.

 

Data structures become much easier to understand when students can see the structure of their data visualized using memory_graph. A data structure is no longer an abstract idea but concrete, clear and debuggable. Here’s a live demo of a Linear Linked List: https://memory-graph.com/#codeurl=https%3A%2F%2Fraw.githubusercontent.com%2Fbterwijn%2Fmemory_graph%2Frefs%2Fheads%2Fmain%2Fsrc%2Flinked_list_lin.py&breakpoints=27&continues=1&timestep=0.2&play=

[–] bterwijn@programming.dev 2 points 1 week ago (1 children)

Incorrect sorry, check the "Solution" link for the correct answer.

12
submitted 1 week ago* (last edited 1 week ago) by bterwijn@programming.dev to c/python@programming.dev
 

An exercise to help build the right mental model for Python data. The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening:

 

Understanding and debugging Python data structures gets easier with memory_graph visualization. Here's a Multiway Tree example. A Multiway Tree is similar to a Binary Tree but has an arbitrary number of children making the tree less deep and more efficient.

 

An exercise to help build the right mental model for Python data. The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening:

[–] bterwijn@programming.dev 3 points 1 month ago (2 children)

__add__ is called with + and __iadd__ is called with +=, and there is a difference: https://www.reddit.com/r/PythonLearning/comments/1nw08wu/right_mental_model_for_python_data/

[–] bterwijn@programming.dev 1 points 1 month ago

Yes a you get for free to set the tone, the others are more interesting.

 

An exercise to help build the right mental model for Python data. The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening:

5
Python bitwise operators (programming.dev)
submitted 1 month ago* (last edited 1 month ago) by bterwijn@programming.dev to c/python@programming.dev
 

Teaching and learning Python bitwise operators gets much easier after showing the binary representations of integers using memory_graph: bitwise operators in Memory Graph Web Debugger

Understanding of the inverse ~ operator is helped by showing the two’s complement representation.

[–] bterwijn@programming.dev 1 points 1 month ago

The whole point is to practice Python Data Model concepts, it's not a best-way-to-code example, so feel free to hate.

[–] bterwijn@programming.dev 1 points 1 month ago

You are right, in landscape mode it's better, but still not ideal. It's a project I don't have time for now. On the other hand, did you run Python code, in an IDE where the debugger visualizes the whole program state, on your Phone before?

[–] bterwijn@programming.dev 0 points 1 month ago

C is incorrect,sorry. See the "Solution" link for the correct answer.

 

An exercise to help build the right mental model for Python data. The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening:

 

Some struggle with recursion, but as package invocation_tree visualizes the Python call tree in real time, it gets easy to understand what is going on and to debug any remaining issues.

See this one-click Quick Sort demo in the Invocation Tree Web Debugger.

 

Better understand the Python Data Model or Data Structures by memory_graph visualization with just one click:

[–] bterwijn@programming.dev 2 points 2 months ago* (last edited 2 months ago) (2 children)

Actually running the code? I got to the stage where only AI can help me understand anything ;-)

[–] bterwijn@programming.dev 2 points 2 months ago* (last edited 2 months ago) (4 children)

Thanks for your feedback, much appriciated.

I agree that an exercise14.rst would be nice, but to save time I've let the code speak for itself now together with the visualizaion. I'll probably revisit and better document the exercises later.

At the Explanation link I try to give a general explanation about Pyrhon mutability (and copy later on), I agree some readers might find it hard to relate that to a specific exercise, but I don't want to write a specific explanation for each exercise.

 

See the Solution and Explanation.

29
Memory Graph Web Debugger (programming.dev)
submitted 2 months ago* (last edited 2 months ago) by bterwijn@programming.dev to c/python@programming.dev
 

Hi, I'm new, I'd like to share my new Memory Graph Web Debugger that you can use to visualize and debug your Python data structures with just one click. This is an example of a binary tree implementation. I feel this tool could level up Python education. I'm interested in your thoughts about it, feedback welcome.

view more: next ›