+ 1
Can anyone please explain below line for me print("{0}-{1}%".format(char, round(perc,2))).??
2 Answers
+ 2
print("{0} - {1}%".format(char, round(perc, 2)))
This line formats a string to contain the processed character (char) at the first index '{0}' and the percentual occurrence of that character (perc) - rounded by 2 decimals - at the second index '{1}'. It then prints the whole string.
So, the first iteration of the loop - counting the occurrence of the letter 'a' - returns 'a - 4.68%.'
+ 1
i can't understand....
can you please explin more....pls?