为什么我无法在我的shell中运行以下行?为什么我不能在我的Python shell中执行这样的代码?
>>> try:
... x = int("a lot")
... except items["error"] as e:
... # Same as except ValueError as e
... print("Couldn't convert")
错误消息:
>>> try: ... x=int("a lot") File "<stdin>", line 2 x=int("a lot")<&>
^
IndentationError: expected an indented block
>>>试试: ... X = INT( “大量”) 文件 “”,2号线 X = INT( “大量”) ^ IndentationError:预计会出现缩进块 –
Muzab
您试图使用哪个shell? –
不会添加其他信息或更正作为评论,编辑您的原始帖子。 –