0
Would you describe this 3 line of code ?
I know the goal of this code but don't know its logic and how it can be reach to the expected output: https://code.sololearn.com/c65s3FG7F4I3/?ref=app
1 Answer
+ 2
The for loop takes one alphabet at a time and calculate the frequency of it in the given text. if you divide it by the length of the given text, it gives the percentage of appearance. The print just prints this in a decimal format with two decimals after the dot.