ChatGPT教程之 03 ChatGPT 中构建 Python 解释器

这个故事的灵感来自于一个类似的故事,在 ChatGPT 中构建虚拟机。我印象深刻并决定尝试类似的东西,但这次不是 Linux 命令行工具,而是让 ChatGPT 成为我们的 Python 解释器。

这是初始化 ChatGPT 的初始命令:

I want you to act as a Python interpreter. I will type commands and you will reply with what the
python output should show. I want you to only reply with the terminal output inside one unique
code block, and nothing else. Do no write explanations, output only what python outputs. Do not type commands unless I
instruct you to do so. When I need to tell you something in English I will do so by putting
text inside curly brackets like this: {example text}. My first command is a=1.

ChatGPT教程之 03 ChatGPT 中构建 Python 解释器
似乎很好用;让我们尝试一些简单的算术表达式。

ChatGPT教程之 03 ChatGPT 中构建 Python 解释器
又工作了;如果我们使用未导入的库会发生什么?

Original: https://blog.csdn.net/iCloudEnd/article/details/128276330
Author: 知识大胖
Title: ChatGPT教程之 03 ChatGPT 中构建 Python 解释器

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/725295/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球