为什么Pycharm在运行中具有不同的输出。和DEBUG?

发布于 2025-02-02 13:56:04 字数 232 浏览 2 评论 0原文

我对set()有问题。此代码在“运行”和“调试”中具有不同的输出。

n = set(input()) #input - 3490
m = set(input()) #input - 9340
if n == m:
    print(True)
else:
    print(False)

运行 - 错误,调试 - 是的。 我不明白为什么会发生这种情况。请帮忙 Python 3.10

I have a problem with set(). This code has different output in 'Run' and in 'Debug'.

n = set(input()) #input - 3490
m = set(input()) #input - 9340
if n == m:
    print(True)
else:
    print(False)

Run - False, Debug - True.
I can't understand why this is happened. Please help
Python 3.10

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

离鸿 2025-02-09 13:56:04

那是Pycharm 2022.1.1的回归。它在运行期间错误地处理了stdin,因此差异。 https:// youtrack。 jetbrains.com/issue/py-54238/stdin-is-lost-for-a-second-input-call

更新为 2022.1.2 RC(释放候选)解决问题的地方

That's a regression in PyCharm 2022.1.1. It handles STDIN incorrectly during the Run hence the difference. https://youtrack.jetbrains.com/issue/PY-54238/STDIN-is-lost-for-a-second-input-call

Update to 2022.1.2 RC (release candidate) where the problem is resolved

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文