遇见数据集

Fraser/python-state-changes

收藏
Hugging Face2022-10-11 更新2024-03-04 收录
官方服务:

资源简介:

数据集Python State Changes包含了单行Python代码执行后的状态变化记录。这些代码来源于Python HackerRank解决方案,并以JSON格式展示,每条记录包括代码执行前的状态、执行的代码和代码执行后的状态。

The dataset Python State Changes contains records of state changes resulting from the execution of single-line Python code snippets. These snippets are sourced from Python solutions to HackerRank problems, and the dataset is presented in JSON format. Each record within the dataset includes three elements: the program state prior to execution, the executed single-line code, and the program state after execution.

提供机构:
Fraser
原始信息汇总

数据集概述

数据集名称

Python State Changes

数据集描述

该数据集记录了Python代码执行过程中的状态变化。所有代码来源于Python HackerRank解决方案。

数据来源

数据集是从跟踪的HackerRank解决方案中抓取的,原始数据集可在此链接找到:Python HackerRank解决方案数据集

数据示例

数据集中的示例展示了代码执行前后的状态变化,以下是几个示例:

  1. 初始状态:g = 100; i = 1; l = [100, 100, 0, 0, -100, -100]
    执行代码:g += l[i]
    最终状态:g = 200; i = 1; l = [100, 100, 0, 0, -100, -100]

  2. 初始状态:a = 1; b = 2; d = 4; i = 3; j = 2
    执行代码:i, j = a + (j - b), b + (d - (i - a))
    最终状态:a = 1; b = 2; d = 4; i = 1; j = 4

  3. 初始状态:b = 15
    执行代码:b = b // 2
    最终状态:b = 7

二维码
社区交流群
二维码
科研交流群
商业服务