banner
andrewji8

Being towards death

Heed not to the tree-rustling and leaf-lashing rain, Why not stroll along, whistle and sing under its rein. Lighter and better suited than horses are straw sandals and a bamboo staff, Who's afraid? A palm-leaf plaited cape provides enough to misty weather in life sustain. A thorny spring breeze sobers up the spirit, I feel a slight chill, The setting sun over the mountain offers greetings still. Looking back over the bleak passage survived, The return in time Shall not be affected by windswept rain or shine.
telegram
twitter
github

A Python learning tool~

For many beginners, learning Python can be a difficult task. Today, I will introduce you to a tool that can help you understand what happens when each line of code is executed on a computer. This tool is very helpful for us to better understand Python execution and debugging.

image

Official website: https://pythontutor.com/#

This tool is called Python Tutor, and it is used to visualize code execution. Whether you are learning Python, Java, C, C++, JavaScript, or Ruby, Python Tutor can help us overcome a basic obstacle in learning programming: understanding what happens when each line of code is executed on a computer.
You can use it to write Python, Java, C, C++, JavaScript, and Ruby code in a web browser and see its execution step by step.
Python Tutor has been used by over 10 million people in more than 180 countries/regions to visualize over 100 million lines of code, often as a supplement to textbooks, lectures, and online tutorials. As far as we know, it is the most widely used program visualization tool in computer education.

How to use it
First, you can choose the programming language you want to execute. I am using Python.

image
From the above image, you can see that the interface is super simple, with three parts explained below:

① Language selection;
② Code input box;
③ Two modes;
Everyone can understand ① and ② at a glance. Now let's talk about the two modes: Visualize Execution and Live Programming Mode.
Visualize Execution mode: After writing the program, you need to manually execute it to see what happens at each step of the program execution.
Live Programming Mode: You don't need to manually execute the program. The system will automatically execute and visualize it as you write each line of code.
Generally, it is better to use Visualize Execution mode. Since we are using this tool, we want to see the execution process of the code clearly, so it is better to execute it step by step and observe the execution results.
Actions speak louder than words. Let's do a demonstration for you directly.

image
For example, we have the code above. Let's see how it is executed.

image
The entire program execution process is presented vividly in front of you. Clear enough, right?

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.