我想写一本iPython笔记本,一套教科书中的问题答案,因为我喜欢这种格式。你知道吗
但我不想离开我的文本编辑器,我希望我最终写的东西是可执行的,因为答案有明确的值,所以我应该能够运行每个“答案”作为一个单元测试。你知道吗
像这样有文化的python环境存在吗?你知道吗
目前我有这个设置,它是原始的python,但我不能嵌入TeX或轻松生成格式良好的文档,这是ipynb非常擅长的。你知道吗
test_question_1():
"""Question: What is the area of a triangle with a base of 3cm and a height of 5cm?
Answer: The general equation for area of a triangle is 0.5*base*height.
"""
base = 3
height = 5
target_answer = 7.5
assert library.area(base=base, height=height) == answer
目前没有回答
相关问题 更多 >
编程相关推荐