TE
TechEcho
Home
24h Top
Newest
Best
Ask
Show
Jobs
English
GitHub
Twitter
Home
Python Tutor: Visualize Code Execution
5 points
by
r4vik
almost 12 years ago
2 comments
mjhea0
almost 12 years ago
<a href="http://www.pythontutor.com/visualize.html#code=%23+Write+a+function,+power(),+that+takes+two+%0A%23+non-negative++integers,+base+and+exponent,+%0A%23+and+prints+the+base+raised+to+the+exponent+%0A%23+power.%0A%0A%23+Do+not+use+the+base+**+exponent+(2**4)+%0A%23+notation.%0A%0A%0Adef+power(base,+exponent)%3A%0A++++new_base+%3D+1%0A++++for+x+in+range(0,exponent)%3A%0A++++++++new_base+*%3D+base%0A++++print+new_base%0A%0Aprint+pow(3,10)+%3D%3D+59049&mode=display&cumulative=false&heapPrimitives=false&drawParentPointers=false&textReferences=false&showOnlyOutputs=false&py=2&curInstr=2" rel="nofollow">http://www.pythontutor.com/visualize.html#code=%23+Write+a+f...</a>
duberton
almost 12 years ago
awesome work!