中级
实现CO2浓度驱动的补碳决策
未完成
中级参考
代码结构已给出,请填写 ____ 处
def solve():
from pyodide.http import open_url
from io import StringIO
import pandas as pd
devs_csv = open_url(____).read()
devs = pd.read_csv(StringIO(____))
CO2_LOW = ____; SOLAR_MIN = ____
def co2_decision(____):
if ____ <= hour <= ____ and solar_rad >= SOLAR_MIN:
if co2_ppm < CO2_LOW:
return '____', {'____':co2_ppm,'____':solar_rad,'____':'____'}
if co2_ppm > ____:
return '____', {'____':co2_ppm,'____':'____'}
return '____', {'____':co2_ppm}
tests = [(____, ____, ____),(____, ____, ____),(____, ____, ____),(____, ____, ____),(____, ____, ____)]
for co2, solar, hour in tests:
decision, info = co2_decision(____)
print("____"+str(____)+"____"+str(____)+"____"+str(____)+"____"+decision)
示例
输入
solve()
期望输出
co2=420ppm solar=650 hour=10: start_co2_generator co2=580ppm solar=650 hour=12: start_co2_generator co2=420ppm solar=50 hour=7: no_action co2=2500ppm solar=0 hour=2: ventilate co2=800ppm solar=650 hour=14: no_action
👑
升级 VIP
解锁全部题目,畅通无阻地学习
- ✓ 解锁全部训练包所有题目
- ✓ 查看完整参考代码和提示
- ✓ 浏览器内直接运行 Python 代码
- ✓ 自动批改 + 进度追踪
30天
¥18
1年
¥99
2年
¥158
3年
¥199