我的 python 代码运行良好,但代码看起来有点乏味和混乱。我想知道是否有更简单的方法来编写它。我有一个文本文件,我需要查找是否可以在该行内找到字母“aardvark”。
if i.casefold().count('a') >= 3 and i.casefold().count('r') >= 2 and i.casefold().count('d') >= 1 and i.casefold().count('v') >= 1 and i.casefold().count('k') >=1: