第 8 步:我们拥有所需动物的所有信息。让我们创建一个使用逻辑对其进行分类的函数!
- 在,在上面写着: MAIN FUNCTION的地方拖入Define Function with Docstring 。
- 这个函数需要五个参数——四个booleans ,然后是animal 。把它改写成这样: def · classify_animal( warm_blooded , · has_scales , · eggs_in_water , · has_hair , · animal ) :
- 最后,将您的文档字符串更改为以下内容: """ Determines the class of an animal """
To navigate the page using the TAB key, first press ESC to exit the code editor.