main.py
Costs 1 credit
加载编辑器中...
输出 Output执行成功
# 运行代码后,输出将显示在这里 # 按 Ctrl+Enter 快速运行
Terminal (Simulated)Install commands are simulated only, no real network requests
$
Step 1: 为 add 函数写断言
先定义 add(a, b),再写两个断言检查结果。
Self-Check List
- 定义 add 函数
- 写 assert 用例
- 输出 step1 passed
Transfer Template
def add(a, b):
return a + bAfter completing this step, you should be able to independently explain and reproduce this concept, then apply it to similar problems.