数据集:

Fraser/python-state-changes

语言:

code
英文

Python 状态变化

执行单行 Python 代码会导致状态的改变。所有代码均来自 Python HackerRank 解决方案。

从我追踪的 HackerRank 解决方案数据集中获取。 https://www.kaggle.com/frasergreenlee/ran-hackerrank-solutions

{"start": "g = 100; i = 1; l = [100, 100, 0, 0, -100, -100]", "code": "g += l[i]", "end": "g = 200; i = 1; l = [100, 100, 0, 0, -100, -100]"}
{"start": "a = 1; b = 2; d = 4; i = 3; j = 2", "code": "i, j = a + (j - b), b + (d - (i - a))", "end": "a = 1; b = 2; d = 4; i = 1; j = 4"}
{"start": "b = 15", "code": "b = b // 2", "end": "b = 7"}

通过查看不同 AST 的频率来概览数据集。

? https://observablehq.com/@frasergreenlee/python-lines-dataset#chart