有缺陷的Python脚本调试提示
来自 Wikiprompt,自由的提示词百科全书
有缺陷的Python脚本调试提示 一个提示,要求AI识别并修复所提供的Python脚本中的错误,并解释这些错误以供学习之用。
提示词内容收藏
🌐
Below is a buggy Python script. Find the errors, fix them, and explain what was wrong:
python
CopyEdit
def factorial(n): if n = 1 return 1 else return n * factorial(n-1) print(factorial(5))
用法
此提示词专为 coding 设计。复制上方内容并粘贴到你常用的 AI 工具中。
为获得最佳效果,可将占位符(方括号或大写字母标示)替换为你的具体需求。
讨论
0 条评论