python online tutor_onlinepythontutor

LEARN programming by visualizing code execution

Online Python Tutor is a free educational tool created by Philip Guo that helps students overcome a fundamental barrier to learning programming: understanding what happens as the computer executes each line of a program's source code. Using this tool, a teacher or student can write a Python program in the Web browser and visualize what the computer is doing step-by-step as it executes the program.

As of Dec 2013, over 500,000 people in over 165 countries have used Online Python Tutor to understand and debug their programs, often as a supplement to textbooks, lecture notes, and online programming tutorials. Over 6,000 pieces of Python code are executed and visualized every day.

Users include self-directed learners, students taking online courses from Coursera, edX, and Udacity, and professors in dozens of universities such as MIT, UC Berkeley, and the University of Washington.

As a demo, here is a visualization showing a program that recursively finds the sum of a (cons-style) linked list. Click the “Forward” button to see what happens as the computer executes each line of code.

1

def listSum(numbers):

2

if not numbers:

3

return 0

4

else:

5

(f, rest) = numbers

6

return f + listSum(rest)

7

8

myList = (1, (2, (3, None)))

9

total = listSum(myList)

< Back

Step 1 of 22

Forward >

line that has just executed

next line to execute

Code visualized with

Online Python Tutor

Frames

Objects

You can also visualize execution in the IPython shell in interactive mode. Watch this one-minute overview:

Proceedings of the ACM Technical Symposium on Computer Science Education (SIGCSE), March 2013.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值