python的in是什么意思_在Python代码中“In [X]:”和“Out [Y]:”是什么意思?

我是一个新的Python用户,我确信这是一个非常基本的问题,但我无法在任何地方找到答案.当人们在线发布Python代码时,它的格式通常如下:

In [1]: # some stuff

Out[1]:

# some more stuff

什么是In,Out和数字?为什么我的Python控制台不那样?

解决方法:

它们不是Python代码.它们是IPython prompts,一个流行的Python附加交互式shell.

在交互式提示符上执行的每行代码(用In表示)都被编号,产生的输出也是编号(用Out表示).然后,您可以指示IPython返回那些输入和输出以重新运行代码或重新使用输出.

IPython offers numbered prompts (In/Out) with input and output caching (also referred to as ‘input history’). All input is saved and can be retrieved as variables (besides the usual arrow key recall), in addition to the %rep magic command that brings a history entry up for editing on the next command line.

标签:python

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值