python - 拼写测试分级机
问题描述
我正在编写一个对拼写蜜蜂单词测试进行评分的代码,下面有我的代码。当我输入代码时它可以工作,但输出只是给了我一个数字,这很好,但我如何将它更改为字母等级而不是数字?
def how_eligible(essay):
total = int(0)
if 'hyperactive' in essay:
total += int(1)
if 'chrysanthemum' in essay:
total += int(1)
if 'onomatopoeia' in essay:
total += int(1)
if 'aardvark' in essay:
total += int(1)
if 'magnanimity' in essay:
total += int(1)
return total
解决方案
推荐阅读
- r - 在数据 R 中分配子组
- android-studio - Gradle - 无法获取配置容器的未知属性“scm”
- ios - 如何为 Xcode 调试器设置断点断言 asCopy 错误
- amazon-cloudwatch - documentDB 实例的事件通知
- node.js - Node.js fs.writeFile() 没有创建新文件?
- python - 将 Python Dataframe 列与固定变量相乘
- json - 如何使用 three.js basic 显示 topojson?
- java - Spring Data JPA:查询ManyToMany,按计数选择
- java - 如何建立依赖于一个语句的条件
- flutter - 如何缓存不影响 UI 和 GPU 性能的图像