TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Learn Python by visualizing code execution

6 pointsby rajeevkover 11 years ago

1 comment

japhyrover 11 years ago
I love using this visualization tool with students who are new to programming. You can create code snippets, and share them through a url.<p>Here is a quick example demonstrating why you need to use a slice to copy a list:<p><a href="http://pythontutor.com/visualize.html#code=my_foods+%3D+%5B&#x27;pizza&#x27;,+&#x27;beer&#x27;,+&#x27;steak+fries&#x27;%5D%0A%0A%23+Want+to+start+with+a+copy+of+my+list%3F%0A%23++Wrong+way%3A%0Ayour_foods+%3D+my_foods%0A%0A%23+Proof+that+it&#x27;s+the+wrong+way%3A%0Ayour_foods.append(&#x27;ice+cream&#x27;)%0A%0A%0Amy_foods.remove(&#x27;ice+cream&#x27;)%0A%23+Proper+way+to+copy+my+list%3A%0Ayour_foods+%3D+my_foods%5B%3A%5D%0A%0A%23+Proof+that+we+have+separate+lists%3A%0Ayour_foods.append(&#x27;ice_cream&#x27;)&amp;mode=display&amp;cumulative=false&amp;heapPrimitives=false&amp;drawParentPointers=false&amp;textReferences=false&amp;showOnlyOutputs=false&amp;py=3&amp;curInstr=0" rel="nofollow">http:&#x2F;&#x2F;pythontutor.com&#x2F;visualize.html#code=my_foods+%3D+%5B&#x27;...</a>