+ 1

I didn't understand that code

for char in "abcdefghijklmnopqrstuvwxyz": perc = 100 * count_char(text, char) / len(text) print("{0} - {1}%".format(char, round(perc, 2)))

1st Jul 2021, 9:34 AM
Ahmed Jezi
3 odpowiedzi
+ 7
How should you? It is not complete.
1st Jul 2021, 9:39 AM
Oma Falk
Oma Falk - avatar
+ 5
This code gives an error. Are you sure you have given the full code? Please give the full code and follow this: https://www.sololearn.com/post/75089/?ref=app
1st Jul 2021, 9:40 AM
The future is now thanks to science
The future is now thanks to science - avatar
+ 4
Ahmed Jezi , as Oma Falk already mentioned: the code seems to be incomplete. ▪︎variable <text> is used but not declared and initialized ▪︎a function count_char() is called but it was never defined further issues may also occur. so please put the complete code in playground and link it here. thanks!
1st Jul 2021, 10:36 AM
Lothar
Lothar - avatar