Python looking to find an easier way to shorten my .casefold().count() -


my python code running fine code looks bit tedious , messy. wondering if there easier way write it. have text file , required find if letters 'aardvark' can found inside line.

if i.casefold().count('a') >= 3 , i.casefold().count('r') >= 2 , i.casefold().count('d') >= 1 , i.casefold().count('v') >= 1 , i.casefold().count('k') >=1: 

if all(  i.casefold().count(letter) >= 'aardvark'.count(letter)  letter in 'aardvark') 

kinda silly solution works


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -