i found below python "for loop" online and its syntax differs from other codes , i like to know about :
- why the 'key' is in front of for loop
- why there is a if statement inline
CODE:
input = "codeforcode"
freqDict = Counter(input)
freq1 = [ key for (key,count) in freqDict.items() if count==1]
further i like to have web links to understand "for loop" more depth in python.
Aucun commentaire:
Enregistrer un commentaire