+ 2
What's with this code?
The exercise consist of taking a text as 1st input and a letter as second then calculating the percentage of the letter in the text. I wrote this but the code is not working. Please I need help. x = input() y = input() a = len(x) b = x.count(y) c = b/a print(int(c)*100)
2 Respostas
+ 3
b/a is lower than 1. When you convert that to int the result is 0.
+ 2
Thank you